Skip to content

Commit

Permalink
move pipelinerun results to output tab
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikjeeyar committed Nov 10, 2023
1 parent 33225d2 commit 69bb0da
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 22 deletions.
43 changes: 43 additions & 0 deletions frontend/packages/pipelines-plugin/console-extensions.json
Expand Up @@ -1115,5 +1115,48 @@
"flags": {
"disallowed": ["HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_DETAIL_METRICS_TAB"]
}
},
{
"type": "console.tab/horizontalNav",
"properties": {
"id": "Output",
"name": "Output",
"model": {
"group": "tekton.dev",
"version": "v1",
"kind": "PipelineRun"
},
"page": {
"name": "%pipelines-plugin~Output%",
"href": "output"
},
"component": { "$codeRef": "ResultsComponent.OutputTab" }
} ,
"flags": {
"required": ["OPENSHIFT_PIPELINE"],
"disallowed": ["CONSOLE_PIPELINE_PLUGIN"]
}
},
{
"type": "console.tab/horizontalNav",
"properties": {
"id": "Output",
"name": "Output",

"model": {
"group": "tekton.dev",
"version": "v1beta1",
"kind": "PipelineRun"
},
"page": {
"name": "%pipelines-plugin~Output%",
"href": "output"
},
"component": { "$codeRef": "ResultsComponent.OutputTab" }
} ,
"flags": {
"required": ["OPENSHIFT_PIPELINE"],
"disallowed": ["CONSOLE_PIPELINE_PLUGIN"]
}
}
]
Expand Up @@ -30,6 +30,7 @@
"Community": "Community",
"Browse tekton hub tasks.": "Browse tekton hub tasks.",
"Metrics": "Metrics",
"Output": "Output",
"Add": "Add",
"{{clusterTaskLabel}} details": "{{clusterTaskLabel}} details",
"Once your Pipeline Repository is configured, in order to update your {{translatedResourceName}} <4>{{name}}</4> automatically, update the following in your <6>.tekton</6> PipelineRun:": "Once your Pipeline Repository is configured, in order to update your {{translatedResourceName}} <4>{{name}}</4> automatically, update the following in your <6>.tekton</6> PipelineRun:",
Expand Down Expand Up @@ -408,6 +409,7 @@
"Events triggering the webhook: ": "Events triggering the webhook: ",
"Read more about setting up webhook": "Read more about setting up webhook",
"No options matching your criteria": "No options matching your criteria",
"No Output found": "No Output found",
"{{resourceName}} results": "{{resourceName}} results",
"No {{resourceName}} results available due to failure": "No {{resourceName}} results available due to failure",
"Empty Directories": "Empty Directories",
Expand Down
3 changes: 2 additions & 1 deletion frontend/packages/pipelines-plugin/package.json
Expand Up @@ -23,7 +23,8 @@
"pipelinesComponent": "src/components/pipelines-index.ts",
"tasksComponent": "src/components/tasks-index.ts",
"triggersComponent": "src/components/triggers-index.ts",
"pacComponent": "src/components/pac/index.ts"
"pacComponent": "src/components/pac/index.ts",
"ResultsComponent": "src/components/shared/results"
}
}
}
@@ -1,9 +1,5 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { PipelineRunModel } from '../../../models';
import { PipelineRunKind } from '../../../types';
import { pipelineRunFilterReducer } from '../../../utils/pipeline-filter-reducer';
import ResultsList from '../../shared/results/ResultsList';
import PipelineRunDetailsSection from './PipelineRunDetailsSection';
import './TriggeredBySection.scss';

Expand All @@ -12,23 +8,9 @@ export interface PipelineRunDetailsProps {
}

export const PipelineRunDetails: React.FC<PipelineRunDetailsProps> = ({ obj: pipelineRun }) => {
const { t } = useTranslation();
return (
<>
<div className="co-m-pane__body odc-pipeline-run-details">
<PipelineRunDetailsSection pipelineRun={pipelineRun} />
</div>

{pipelineRun.status?.pipelineResults ||
(pipelineRun.status?.results && (
<div className="co-m-pane__body">
<ResultsList
results={pipelineRun.status?.pipelineResults || pipelineRun.status?.results}
resourceName={t(PipelineRunModel.labelKey)}
status={pipelineRunFilterReducer(pipelineRun)}
/>
</div>
))}
</>
<div className="co-m-pane__body odc-pipeline-run-details">
<PipelineRunDetailsSection pipelineRun={pipelineRun} />
</div>
);
};
@@ -0,0 +1,28 @@
import * as React from 'react';
import { EmptyState, EmptyStateBody, EmptyStateVariant } from '@patternfly/react-core';
import { useTranslation } from 'react-i18next';
import { PipelineRunModel } from '../../../models';
import { PipelineRunKind } from '../../../types';
import { pipelineRunFilterReducer } from '../../../utils/pipeline-filter-reducer';
import ResultsList from './ResultsList';

const OutputTab: React.FC<{ obj: PipelineRunKind }> = ({ obj: pipelineRun }) => {
const { t } = useTranslation();

return pipelineRun.status?.pipelineResults || pipelineRun.status?.results ? (
<div className="co-m-pane__body">
<ResultsList
results={pipelineRun.status?.pipelineResults || pipelineRun.status?.results}
resourceName={t(PipelineRunModel.labelKey)}
status={pipelineRunFilterReducer(pipelineRun)}
/>
</div>
) : (
<EmptyState variant={EmptyStateVariant.full}>
<EmptyStateBody>
<p>{t('pipelines-plugin~No Output found')}</p>
</EmptyStateBody>
</EmptyState>
);
};
export default OutputTab;
@@ -0,0 +1 @@
export { default as OutputTab } from './OutputTab';

0 comments on commit 69bb0da

Please sign in to comment.