Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODC-7423: move pipelinerun results to output tab #13323

Merged
merged 1 commit into from Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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';