@backstage-community/plugin-tekton 3.28.0 → 3.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/PipelineRunList/PipelineRunColumnHeader.esm.js.map +1 -1
  3. package/dist/components/PipelineRunList/PipelineRunList.esm.js +2 -1
  4. package/dist/components/PipelineRunList/PipelineRunList.esm.js.map +1 -1
  5. package/dist/components/PipelineRunList/PipelineRunListSearchBar.esm.js +2 -1
  6. package/dist/components/PipelineRunList/PipelineRunListSearchBar.esm.js.map +1 -1
  7. package/dist/components/PipelineRunList/PipelineRunOutput.esm.js +2 -1
  8. package/dist/components/PipelineRunList/PipelineRunOutput.esm.js.map +1 -1
  9. package/dist/components/PipelineRunList/PipelineRunRow.esm.js +2 -1
  10. package/dist/components/PipelineRunList/PipelineRunRow.esm.js.map +1 -1
  11. package/dist/components/PipelineRunList/PipelineRunRowActions.esm.js +2 -1
  12. package/dist/components/PipelineRunList/PipelineRunRowActions.esm.js.map +1 -1
  13. package/dist/components/PipelineRunList/PipelineRunVulnerabilities.esm.js +2 -1
  14. package/dist/components/PipelineRunList/PipelineRunVulnerabilities.esm.js.map +1 -1
  15. package/dist/components/PipelineRunList/PipelineTableHeader.esm.js +2 -1
  16. package/dist/components/PipelineRunList/PipelineTableHeader.esm.js.map +1 -1
  17. package/dist/components/PipelineRunList/PlrStatus.esm.js +2 -1
  18. package/dist/components/PipelineRunList/PlrStatus.esm.js.map +1 -1
  19. package/dist/components/PipelineRunLogs/PipelineRunLogDialog.esm.js +2 -1
  20. package/dist/components/PipelineRunLogs/PipelineRunLogDialog.esm.js.map +1 -1
  21. package/dist/components/PipelineRunLogs/PipelineRunLogDownloader.esm.js +2 -1
  22. package/dist/components/PipelineRunLogs/PipelineRunLogDownloader.esm.js.map +1 -1
  23. package/dist/components/PipelineRunLogs/PipelineRunLogViewer.esm.js +2 -1
  24. package/dist/components/PipelineRunLogs/PipelineRunLogViewer.esm.js.map +1 -1
  25. package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js +2 -1
  26. package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js.map +1 -1
  27. package/dist/components/PipelineRunLogs/PodLogsDownloadLink.esm.js +2 -1
  28. package/dist/components/PipelineRunLogs/PodLogsDownloadLink.esm.js.map +1 -1
  29. package/dist/components/PipelineRunLogs/TaskStatusStepper.esm.js +2 -1
  30. package/dist/components/PipelineRunLogs/TaskStatusStepper.esm.js.map +1 -1
  31. package/dist/components/PipelineRunOutput/PipelineRunOutputDialog.esm.js +2 -1
  32. package/dist/components/PipelineRunOutput/PipelineRunOutputDialog.esm.js.map +1 -1
  33. package/dist/components/common/ErrorPanel.esm.js +2 -1
  34. package/dist/components/common/ErrorPanel.esm.js.map +1 -1
  35. package/dist/components/common/PermissionAlert.esm.js +2 -1
  36. package/dist/components/common/PermissionAlert.esm.js.map +1 -1
  37. package/dist/components/common/StatusSelector.esm.js +2 -1
  38. package/dist/components/common/StatusSelector.esm.js.map +1 -1
  39. package/dist/components/common/TableExpandCollapse.esm.js +2 -1
  40. package/dist/components/common/TableExpandCollapse.esm.js.map +1 -1
  41. package/dist/components/pipeline-topology/PipelineTaskNode.esm.js +2 -1
  42. package/dist/components/pipeline-topology/PipelineTaskNode.esm.js.map +1 -1
  43. package/dist/components/pipeline-topology/PipelineVisualization.esm.js +2 -1
  44. package/dist/components/pipeline-topology/PipelineVisualization.esm.js.map +1 -1
  45. package/dist/components/pipeline-topology/PipelineVisualizationStepList.esm.js +2 -1
  46. package/dist/components/pipeline-topology/PipelineVisualizationStepList.esm.js.map +1 -1
  47. package/dist/components/pipeline-topology/PipelineVisualizationView.esm.js +2 -1
  48. package/dist/components/pipeline-topology/PipelineVisualizationView.esm.js.map +1 -1
  49. package/dist/index.d.ts +7 -1
  50. package/dist/index.esm.js +2 -1
  51. package/dist/index.esm.js.map +1 -1
  52. package/dist/translations/index.esm.js +10 -0
  53. package/dist/translations/index.esm.js.map +1 -0
  54. package/dist/{translation.esm.js → translations/ref.esm.js} +1 -1
  55. package/dist/{translation.esm.js.map → translations/ref.esm.js.map} +1 -1
  56. package/dist/utils/pipeline-step-utils.esm.js.map +1 -1
  57. package/dist/utils/tekton-utils.esm.js.map +1 -1
  58. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineRunLogViewer.esm.js","sources":["../../../src/components/PipelineRunLogs/PipelineRunLogViewer.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DismissableBanner, LogViewer } from '@backstage/core-components';\nimport { V1Container, V1Pod } from '@kubernetes/client-node';\nimport { Paper } from '@material-ui/core';\nimport { Skeleton } from '@material-ui/lab';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { usePodLogsOfPipelineRun } from '../../hooks/usePodLogsOfPipelineRun';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype PipelineRunLogViewerProps = { pod: V1Pod };\n\nconst PipelineRunLogViewer = ({ pod }: PipelineRunLogViewerProps) => {\n const { value, error, loading } = usePodLogsOfPipelineRun({\n pod,\n });\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const containersList = pod?.spec?.containers || [];\n let text = '';\n\n text = containersList.reduce(\n (acc: string, container: V1Container, idx: number) => {\n if (container?.name && value?.[idx]?.text) {\n return acc\n .concat(\n `${container.name.toLocaleUpperCase('en-US')}\\n${value[idx].text}`,\n )\n .concat(idx === containersList.length - 1 ? '' : '\\n');\n }\n return acc;\n },\n '',\n );\n\n return (\n <>\n {error && (\n <DismissableBanner\n message={error?.message}\n variant=\"error\"\n fixed={false}\n id=\"pod-logs\"\n />\n )}\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '30rem' }}\n >\n {loading && (\n <Skeleton\n data-testid=\"logs-skeleton\"\n variant=\"rect\"\n width=\"100%\"\n height=\"100%\"\n />\n )}\n {pod && !loading && (\n <LogViewer text={text || t('pipelineRunLogs.noLogs')} />\n )}\n </Paper>\n </>\n );\n};\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n retry: 5,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nconst PipelineRunLogViewerWithQueryClient = ({\n pod,\n}: PipelineRunLogViewerProps) => {\n return (\n <QueryClientProvider client={queryClient}>\n <PipelineRunLogViewer pod={pod} />\n </QueryClientProvider>\n );\n};\n\nexport { PipelineRunLogViewerWithQueryClient as PipelineRunLogViewer };\n"],"names":[],"mappings":";;;;;;;;;AA0BA,MAAM,oBAAA,GAAuB,CAAC,EAAE,GAAA,EAAI,KAAiC;AACnE,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,OAAA,KAAY,uBAAA,CAAwB;AAAA,IACxD;AAAA,GACD,CAAA;AACD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,cAAA,GAAiB,GAAA,EAAK,IAAA,EAAM,UAAA,IAAc,EAAC;AACjD,EAAA,IAAI,IAAA,GAAO,EAAA;AAEX,EAAA,IAAA,GAAO,cAAA,CAAe,MAAA;AAAA,IACpB,CAAC,GAAA,EAAa,SAAA,EAAwB,GAAA,KAAgB;AACpD,MAAA,IAAI,SAAA,EAAW,IAAA,IAAQ,KAAA,GAAQ,GAAG,GAAG,IAAA,EAAM;AACzC,QAAA,OAAO,GAAA,CACJ,MAAA;AAAA,UACC,CAAA,EAAG,SAAA,CAAU,IAAA,CAAK,iBA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CAAsC,CAAC;AAAA,EAC3C;AACF,CAAA,KAAiC;AAC/B,EAAA,2BACG,mBAAA,EAAA,EAAoB,MAAA,EAAQ,aAC3B,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAU,CAAA,EAClC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PipelineRunLogViewer.esm.js","sources":["../../../src/components/PipelineRunLogs/PipelineRunLogViewer.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DismissableBanner, LogViewer } from '@backstage/core-components';\nimport { V1Container, V1Pod } from '@kubernetes/client-node';\nimport { Paper } from '@material-ui/core';\nimport { Skeleton } from '@material-ui/lab';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { usePodLogsOfPipelineRun } from '../../hooks/usePodLogsOfPipelineRun';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineRunLogViewerProps = { pod: V1Pod };\n\nconst PipelineRunLogViewer = ({ pod }: PipelineRunLogViewerProps) => {\n const { value, error, loading } = usePodLogsOfPipelineRun({\n pod,\n });\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const containersList = pod?.spec?.containers || [];\n let text = '';\n\n text = containersList.reduce(\n (acc: string, container: V1Container, idx: number) => {\n if (container?.name && value?.[idx]?.text) {\n return acc\n .concat(\n `${container.name.toLocaleUpperCase('en-US')}\\n${value[idx].text}`,\n )\n .concat(idx === containersList.length - 1 ? '' : '\\n');\n }\n return acc;\n },\n '',\n );\n\n return (\n <>\n {error && (\n <DismissableBanner\n message={error?.message}\n variant=\"error\"\n fixed={false}\n id=\"pod-logs\"\n />\n )}\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '30rem' }}\n >\n {loading && (\n <Skeleton\n data-testid=\"logs-skeleton\"\n variant=\"rect\"\n width=\"100%\"\n height=\"100%\"\n />\n )}\n {pod && !loading && (\n <LogViewer text={text || t('pipelineRunLogs.noLogs')} />\n )}\n </Paper>\n </>\n );\n};\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n retry: 5,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nconst PipelineRunLogViewerWithQueryClient = ({\n pod,\n}: PipelineRunLogViewerProps) => {\n return (\n <QueryClientProvider client={queryClient}>\n <PipelineRunLogViewer pod={pod} />\n </QueryClientProvider>\n );\n};\n\nexport { PipelineRunLogViewerWithQueryClient as PipelineRunLogViewer };\n"],"names":[],"mappings":";;;;;;;;;;AA0BA,MAAM,oBAAA,GAAuB,CAAC,EAAE,GAAA,EAAI,KAAiC;AACnE,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,OAAA,KAAY,uBAAA,CAAwB;AAAA,IACxD;AAAA,GACD,CAAA;AACD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,cAAA,GAAiB,GAAA,EAAK,IAAA,EAAM,UAAA,IAAc,EAAC;AACjD,EAAA,IAAI,IAAA,GAAO,EAAA;AAEX,EAAA,IAAA,GAAO,cAAA,CAAe,MAAA;AAAA,IACpB,CAAC,GAAA,EAAa,SAAA,EAAwB,GAAA,KAAgB;AACpD,MAAA,IAAI,SAAA,EAAW,IAAA,IAAQ,KAAA,GAAQ,GAAG,GAAG,IAAA,EAAM;AACzC,QAAA,OAAO,GAAA,CACJ,MAAA;AAAA,UACC,CAAA,EAAG,SAAA,CAAU,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAC;AAAA,E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,CAAA,KAAiC;AAC/B,EAAA,2BACG,mBAAA,EAAA,EAAoB,MAAA,EAAQ,aAC3B,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAU,CAAA,EAClC,CAAA;AAEJ;;;;"}
@@ -8,7 +8,8 @@ import { getSortedTaskRuns, getActiveTaskRun } from '../../utils/taskRun-utils.e
8
8
  import { PipelineRunLogViewer as PipelineRunLogViewerWithQueryClient } from './PipelineRunLogViewer.esm.js';
9
9
  import { TaskStatusStepper } from './TaskStatusStepper.esm.js';
10
10
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
11
- import { tektonTranslationRef } from '../../translation.esm.js';
11
+ import '../../translations/index.esm.js';
12
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
12
13
 
13
14
  const PipelineRunLogs = ({
14
15
  pipelineRun,
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineRunLogs.esm.js","sources":["../../../src/components/PipelineRunLogs/PipelineRunLogs.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useEffect, useMemo } from 'react';\n\nimport { LogViewer, Progress } from '@backstage/core-components';\n\nimport { V1Pod } from '@kubernetes/client-node';\nimport { Paper } from '@material-ui/core';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n getTaskRunsForPipelineRun,\n pipelineRunFilterReducer,\n PipelineRunKind,\n TaskRunKind,\n} from '@janus-idp/shared-react';\n\nimport { getActiveTaskRun, getSortedTaskRuns } from '../../utils/taskRun-utils';\nimport { PipelineRunLogViewer } from './PipelineRunLogViewer';\nimport { TaskStatusStepper } from './TaskStatusStepper';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype PipelineRunLogsProps = {\n pipelineRun: PipelineRunKind;\n taskRuns: TaskRunKind[];\n pods: V1Pod[];\n activeTask?: string;\n setActiveTask: (t: string) => void;\n};\nexport const PipelineRunLogs = ({\n pipelineRun,\n taskRuns,\n pods,\n activeTask,\n setActiveTask,\n}: PipelineRunLogsProps) => {\n const PLRTaskRuns = getTaskRunsForPipelineRun(pipelineRun, taskRuns);\n const sortedTaskRuns = getSortedTaskRuns(PLRTaskRuns);\n const taskRunFromYaml = PLRTaskRuns?.reduce(\n (acc: { [value: string]: TaskRunKind }, value) => {\n if (value?.metadata?.name) {\n acc[value.metadata.name] = value;\n }\n return acc;\n },\n {},\n );\n\n const completed = pipelineRunFilterReducer(pipelineRun);\n const [lastActiveStepId, setLastActiveStepId] = useState<string>('');\n const { t } = useTranslationRef(tektonTranslationRef);\n\n useEffect(() => {\n const mostRecentFailedOrActiveStep = sortedTaskRuns.find(tr =>\n ['Failed', 'Running'].includes(tr.status),\n );\n\n if (completed && !mostRecentFailedOrActiveStep && !activeTask) {\n setLastActiveStepId(sortedTaskRuns[sortedTaskRuns.length - 1]?.id);\n return;\n }\n\n setLastActiveStepId(\n !activeTask ? (mostRecentFailedOrActiveStep?.id as string) : '',\n );\n }, [sortedTaskRuns, completed, activeTask]);\n\n const currentStepId = activeTask || lastActiveStepId;\n const activeItem = getActiveTaskRun(sortedTaskRuns, currentStepId);\n const podName =\n activeItem && taskRunFromYaml?.[currentStepId]?.status?.podName;\n const podData = useMemo(\n () =>\n pods.find(pod => {\n return pod?.metadata?.name === podName;\n }),\n [pods, podName],\n );\n\n return (\n <Grid container>\n <Grid item xs={3}>\n <Paper>\n <TaskStatusStepper\n steps={sortedTaskRuns}\n currentStepId={currentStepId}\n onUserStepChange={setActiveTask}\n />\n </Paper>\n </Grid>\n <Grid item xs={9}>\n {!currentStepId && <Progress />}\n <div style={{ height: '80vh' }}>\n {!podData ? (\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '30rem' }}\n >\n <LogViewer text={t('pipelineRunLogs.noLogs')} />\n </Paper>\n ) : (\n <PipelineRunLogViewer pod={podData} />\n )}\n </div>\n </Grid>\n </Grid>\n );\n};\n\nexport default PipelineRunLogs;\n"],"names":["PipelineRunLogViewer"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,WAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAA4B;AAC1B,EAAA,MAAM,WAAA,GAAc,yBAAA,CAA0B,WAAA,EAAa,QAAQ,CAAA;AACnE,EAAA,MAAM,cAAA,GAAiB,kBAAkB,WAAW,CAAA;AACpD,EAAA,MAAM,kBAAkB,WAAA,EAAa,MAAA;AAAA,IACnC,CAAC,KAAuC,KAAA,KAAU;AAChD,MAAA,IAAI,KAAA,EAAO,UAAU,IAAA,EAAM;AACzB,QAAA,GAAA,CAAI,KAAA,CAAM,QAAA,CAAS,IAAI,CAAA,GAAI,KAAA;AAAA,MAC7B;AACA,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,MAAM,SAAA,GAAY,yBAAyB,WAAW,CAAA;AACtD,EAAA,MAAM,CAAC,gBAAA,EAAkB,mBAAmB,CAAA,GAAI,SAAiB,EAAE,CAAA;AACnE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,+BAA+B,cAAA,CAAe,IAAA;AAAA,MAAK,QACvD,CAAC,QAAA,EAAU,SAAS,CAAA,CAAE,QAAA,CAAS,GAAG,MAAM;AAAA,KAC1C;AAEA,IAAA,IAAI,SAAA,IAAa,CAAC,4BAAA,IAAgC,CAAC,UAAA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AO,EAAE,QAAQ,MAAA,EAAO,EAC1B,WAAC,OAAA,mBACA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,CAAA;AAAA,UACX,OAAO,EAAE,MAAA,EAAQ,QAAQ,KAAA,EAAO,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,UAE3D,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,IAAA,EAAM,CAAA,CAAE,wBAAwB,CAAA,EAAG;AAAA;AAAA,OAChD,mBAEA,GAAA,CAACA,mCAAA,EAAA,EAAqB,GAAA,EAAK,SAAS,CAAA,EAExC;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PipelineRunLogs.esm.js","sources":["../../../src/components/PipelineRunLogs/PipelineRunLogs.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useEffect, useMemo } from 'react';\n\nimport { LogViewer, Progress } from '@backstage/core-components';\n\nimport { V1Pod } from '@kubernetes/client-node';\nimport { Paper } from '@material-ui/core';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n getTaskRunsForPipelineRun,\n pipelineRunFilterReducer,\n PipelineRunKind,\n TaskRunKind,\n} from '@janus-idp/shared-react';\n\nimport { getActiveTaskRun, getSortedTaskRuns } from '../../utils/taskRun-utils';\nimport { PipelineRunLogViewer } from './PipelineRunLogViewer';\nimport { TaskStatusStepper } from './TaskStatusStepper';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineRunLogsProps = {\n pipelineRun: PipelineRunKind;\n taskRuns: TaskRunKind[];\n pods: V1Pod[];\n activeTask?: string;\n setActiveTask: (t: string) => void;\n};\nexport const PipelineRunLogs = ({\n pipelineRun,\n taskRuns,\n pods,\n activeTask,\n setActiveTask,\n}: PipelineRunLogsProps) => {\n const PLRTaskRuns = getTaskRunsForPipelineRun(pipelineRun, taskRuns);\n const sortedTaskRuns = getSortedTaskRuns(PLRTaskRuns);\n const taskRunFromYaml = PLRTaskRuns?.reduce(\n (acc: { [value: string]: TaskRunKind }, value) => {\n if (value?.metadata?.name) {\n acc[value.metadata.name] = value;\n }\n return acc;\n },\n {},\n );\n\n const completed = pipelineRunFilterReducer(pipelineRun);\n const [lastActiveStepId, setLastActiveStepId] = useState<string>('');\n const { t } = useTranslationRef(tektonTranslationRef);\n\n useEffect(() => {\n const mostRecentFailedOrActiveStep = sortedTaskRuns.find(tr =>\n ['Failed', 'Running'].includes(tr.status),\n );\n\n if (completed && !mostRecentFailedOrActiveStep && !activeTask) {\n setLastActiveStepId(sortedTaskRuns[sortedTaskRuns.length - 1]?.id);\n return;\n }\n\n setLastActiveStepId(\n !activeTask ? (mostRecentFailedOrActiveStep?.id as string) : '',\n );\n }, [sortedTaskRuns, completed, activeTask]);\n\n const currentStepId = activeTask || lastActiveStepId;\n const activeItem = getActiveTaskRun(sortedTaskRuns, currentStepId);\n const podName =\n activeItem && taskRunFromYaml?.[currentStepId]?.status?.podName;\n const podData = useMemo(\n () =>\n pods.find(pod => {\n return pod?.metadata?.name === podName;\n }),\n [pods, podName],\n );\n\n return (\n <Grid container>\n <Grid item xs={3}>\n <Paper>\n <TaskStatusStepper\n steps={sortedTaskRuns}\n currentStepId={currentStepId}\n onUserStepChange={setActiveTask}\n />\n </Paper>\n </Grid>\n <Grid item xs={9}>\n {!currentStepId && <Progress />}\n <div style={{ height: '80vh' }}>\n {!podData ? (\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '30rem' }}\n >\n <LogViewer text={t('pipelineRunLogs.noLogs')} />\n </Paper>\n ) : (\n <PipelineRunLogViewer pod={podData} />\n )}\n </div>\n </Grid>\n </Grid>\n );\n};\n\nexport default PipelineRunLogs;\n"],"names":["PipelineRunLogViewer"],"mappings":";;;;;;;;;;;;;AA2CO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,WAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAA4B;AAC1B,EAAA,MAAM,WAAA,GAAc,yBAAA,CAA0B,WAAA,EAAa,QAAQ,CAAA;AACnE,EAAA,MAAM,cAAA,GAAiB,kBAAkB,WAAW,CAAA;AACpD,EAAA,MAAM,kBAAkB,WAAA,EAAa,MAAA;AAAA,IACnC,CAAC,KAAuC,KAAA,KAAU;AAChD,MAAA,IAAI,KAAA,EAAO,UAAU,IAAA,EAAM;AACzB,QAAA,GAAA,CAAI,KAAA,CAAM,QAAA,CAAS,IAAI,CAAA,GAAI,KAAA;AAAA,MAC7B;AACA,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,MAAM,SAAA,GAAY,yBAAyB,WAAW,CAAA;AACtD,EAAA,MAAM,CAAC,gBAAA,EAAkB,mBAAmB,CAAA,GAAI,SAAiB,EAAE,CAAA;AACnE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,+BAA+B,cAAA,CAAe,IAAA;AAAA,MAAK,QACvD,CAAC,QAAA,EAAU,SAAS,CAAA,CAAE,QAAA,CAAS,GAAG,MAAM;AAAA,KAC1C;AAEA,IAAA,IAAI,SAAA,IAAa,CAAC,4BAAA,IAAgC,CAAC,UAAA,EAAY;AAC7D,MAAA,mBAAA,CAAoB,cAAA,CAAe,cAAA,CAAe,MAAA,GAAS,CAAC,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;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,CAAA;AAAA,UACX,OAAO,EAAE,MAAA,EAAQ,QAAQ,KAAA,EAAO,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,UAE3D,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,IAAA,EAAM,CAAA,CAAE,wBAAwB,CAAA,EAAG;AAAA;AAAA,OAChD,mBAEA,GAAA,CAACA,mCAAA,EAAA,EAAqB,GAAA,EAAK,SAAS,CAAA,EAExC;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -8,8 +8,9 @@ import classNames from 'classnames';
8
8
  import { TektonResourcesContext } from '../../hooks/TektonResourcesContext.esm.js';
9
9
  import { getPodLogs } from '../../utils/log-downloader-utils.esm.js';
10
10
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
11
- import { tektonTranslationRef } from '../../translation.esm.js';
11
+ import '../../translations/index.esm.js';
12
12
  import { downloadLogFile } from '../../utils/download-log-file-utils.esm.js';
13
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
13
14
 
14
15
  const useStyles = makeStyles(
15
16
  (theme) => createStyles({
@@ -1 +1 @@
1
- {"version":3,"file":"PodLogsDownloadLink.esm.js","sources":["../../../src/components/PipelineRunLogs/PodLogsDownloadLink.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { FC, ReactElement } from 'react';\n\nimport { useState, useContext } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '@backstage/plugin-kubernetes-react';\n\nimport { V1Pod } from '@kubernetes/client-node';\nimport { createStyles, Link, makeStyles, Theme } from '@material-ui/core';\nimport DownloadIcon from '@mui/icons-material/FileDownloadOutlined';\nimport classNames from 'classnames';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { ContainerScope } from '../../hooks/usePodLogsOfPipelineRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { getPodLogs } from '../../utils/log-downloader-utils';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\nimport { downloadLogFile } from '../../utils/download-log-file-utils';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n downloadAction: {\n position: 'relative',\n marginBottom: 'var(--pf-t--global--spacer--sm)',\n color: 'var(--pf-t--global--icon--color--100)',\n cursor: 'pointer',\n },\n buttonDisabled: {\n color: theme.palette.grey[400],\n cursor: 'not-allowed',\n },\n }),\n);\n\nconst PodLogsDownloadLink: FC<{\n pods: V1Pod[];\n fileName: string;\n downloadTitle: string;\n}> = ({ pods, fileName, downloadTitle, ...props }): ReactElement => {\n const classes = useStyles();\n const [downloading, setDownloading] = useState<boolean>(false);\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const { clusters, selectedCluster = 0 } =\n useContext<TektonResourcesContextData>(TektonResourcesContext);\n const currCluster = clusters.length > 0 ? clusters[selectedCluster] : '';\n\n const getLogs = (podScope: ContainerScope): Promise<{ text: string }> => {\n const { podName, podNamespace, containerName, clusterName } = podScope;\n return kubernetesProxyApi.getPodLogs({\n podName: podName,\n namespace: podNamespace,\n containerName: containerName,\n clusterName: clusterName,\n });\n };\n\n return (\n <Link\n component=\"button\"\n variant=\"body2\"\n underline=\"none\"\n disabled={downloading}\n title={\n downloading\n ? t('pipelineRunLogs.podLogsDownloadLink.downloading')\n : downloadTitle\n }\n onClick={() => {\n setDownloading(true);\n getPodLogs(pods, getLogs, currCluster)\n .then((logs: string) => {\n setDownloading(false);\n downloadLogFile(logs || '', fileName);\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.warn('Download failed', err);\n setDownloading(false);\n });\n }}\n className={classNames(classes.downloadAction, {\n [classes.buttonDisabled]: downloading,\n })}\n {...props}\n >\n <DownloadIcon style={{ verticalAlign: '-0.180em' }} />\n {downloadTitle || t('pipelineRunLogs.podLogsDownloadLink.title')}\n </Link>\n );\n};\nexport default PodLogsDownloadLink;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,cAAA,EAAgB;AAAA,MACd,QAAA,EAAU,UAAA;AAAA,MACV,YAAA,EAAc,iCAAA;AAAA,MACd,KAAA,EAAO,uCAAA;AAAA,MACP,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG,CAAA;AAAA,MAC7B,MAAA,EAAQ;AAAA;AACV,GACD;AACH,CAAA;AAEA,MAAM,mBAAA,GAID,CAAC,EAAE,IAAA,EAAM,UAAU,aAAA,EAAe,GAAG,OAAM,KAAoB;AAClE,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC7D,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AACvD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,EAAE,QAAA,EAAU,eAAA,GAAkB,CAAA,EAAE,GACpC,WAAuC,sBAAsB,CAAA;AAC/D,EAAA,MAAM,cAAc,QAAA,CAAS,MAAA,GAAS,CAAA,GAAI,QAAA,CAAS,eAAe,CAAA,GAAI,EAAA;AAEtE,EAAA,MAAM,OAAA,GA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C;AAAA;AAAA;AAAA,GACjE;AAEJ;;;;"}
1
+ {"version":3,"file":"PodLogsDownloadLink.esm.js","sources":["../../../src/components/PipelineRunLogs/PodLogsDownloadLink.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { FC, ReactElement } from 'react';\n\nimport { useState, useContext } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '@backstage/plugin-kubernetes-react';\n\nimport { V1Pod } from '@kubernetes/client-node';\nimport { createStyles, Link, makeStyles, Theme } from '@material-ui/core';\nimport DownloadIcon from '@mui/icons-material/FileDownloadOutlined';\nimport classNames from 'classnames';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { ContainerScope } from '../../hooks/usePodLogsOfPipelineRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { getPodLogs } from '../../utils/log-downloader-utils';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\nimport { downloadLogFile } from '../../utils/download-log-file-utils';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n downloadAction: {\n position: 'relative',\n marginBottom: 'var(--pf-t--global--spacer--sm)',\n color: 'var(--pf-t--global--icon--color--100)',\n cursor: 'pointer',\n },\n buttonDisabled: {\n color: theme.palette.grey[400],\n cursor: 'not-allowed',\n },\n }),\n);\n\nconst PodLogsDownloadLink: FC<{\n pods: V1Pod[];\n fileName: string;\n downloadTitle: string;\n}> = ({ pods, fileName, downloadTitle, ...props }): ReactElement => {\n const classes = useStyles();\n const [downloading, setDownloading] = useState<boolean>(false);\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const { clusters, selectedCluster = 0 } =\n useContext<TektonResourcesContextData>(TektonResourcesContext);\n const currCluster = clusters.length > 0 ? clusters[selectedCluster] : '';\n\n const getLogs = (podScope: ContainerScope): Promise<{ text: string }> => {\n const { podName, podNamespace, containerName, clusterName } = podScope;\n return kubernetesProxyApi.getPodLogs({\n podName: podName,\n namespace: podNamespace,\n containerName: containerName,\n clusterName: clusterName,\n });\n };\n\n return (\n <Link\n component=\"button\"\n variant=\"body2\"\n underline=\"none\"\n disabled={downloading}\n title={\n downloading\n ? t('pipelineRunLogs.podLogsDownloadLink.downloading')\n : downloadTitle\n }\n onClick={() => {\n setDownloading(true);\n getPodLogs(pods, getLogs, currCluster)\n .then((logs: string) => {\n setDownloading(false);\n downloadLogFile(logs || '', fileName);\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.warn('Download failed', err);\n setDownloading(false);\n });\n }}\n className={classNames(classes.downloadAction, {\n [classes.buttonDisabled]: downloading,\n })}\n {...props}\n >\n <DownloadIcon style={{ verticalAlign: '-0.180em' }} />\n {downloadTitle || t('pipelineRunLogs.podLogsDownloadLink.title')}\n </Link>\n );\n};\nexport default PodLogsDownloadLink;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,cAAA,EAAgB;AAAA,MACd,QAAA,EAAU,UAAA;AAAA,MACV,YAAA,EAAc,iCAAA;AAAA,MACd,KAAA,EAAO,uCAAA;AAAA,MACP,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG,CAAA;AAAA,MAC7B,MAAA,EAAQ;AAAA;AACV,GACD;AACH,CAAA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,CAAgB,IAAA,IAAQ,IAAI,QAAQ,CAAA;AAAA,QACtC,CAAC,CAAA,CACA,KAAA,CAAM,CAAA,GAAA,KAAO;AAEZ,UAAA,OAAA,CAAQ,IAAA,CAAK,mBAAmB,GAAG,CAAA;AACnC,UAAA,cAAA,CAAe,KAAK,CAAA;AAAA,QACtB,CAAC,CAAA;AAAA,MACL,CAAA;AAAA,MACA,SAAA,EAAW,UAAA,CAAW,OAAA,CAAQ,cAAA,EAAgB;AAAA,QAC5C,CAAC,OAAA,CAAQ,cAAc,GAAG;AAAA,OAC3B,CAAA;AAAA,MACA,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,KAAA,EAAO,EAAE,aAAA,EAAe,YAAW,EAAG,CAAA;AAAA,QACnD,aAAA,IAAiB,EAAE,2CAA2C;AAAA;AAAA;AAAA,GACjE;AAEJ;;;;"}
@@ -13,7 +13,8 @@ import classNames from 'classnames';
13
13
  import { ComputedStatus } from '@janus-idp/shared-react';
14
14
  import { calculateDuration } from '../../utils/tekton-utils.esm.js';
15
15
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
16
- import { tektonTranslationRef } from '../../translation.esm.js';
16
+ import '../../translations/index.esm.js';
17
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
17
18
 
18
19
  const useStyles = makeStyles(
19
20
  (theme) => createStyles({
@@ -1 +1 @@
1
- {"version":3,"file":"TaskStatusStepper.esm.js","sources":["../../../src/components/PipelineRunLogs/TaskStatusStepper.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, memo } from 'react';\nimport useInterval from 'react-use/lib/useInterval';\n\nimport {\n CircularProgress,\n createStyles,\n makeStyles,\n StepButton,\n StepIconProps,\n Theme,\n} from '@material-ui/core';\nimport Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport Cancel from '@material-ui/icons/Cancel';\nimport Check from '@material-ui/icons/Check';\nimport FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';\nimport classNames from 'classnames';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TaskStep } from '../../utils/taskRun-utils';\nimport { calculateDuration } from '../../utils/tekton-utils';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n },\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n labelWrapper: {\n display: 'flex',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n stepWrapper: {\n width: '100%',\n },\n }),\n);\n\nconst StepTimeTicker = ({ step }: { step: TaskStep }) => {\n const [time, setTime] = useState('');\n const { t } = useTranslationRef(tektonTranslationRef);\n\n useInterval(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n setTime(calculateDuration(t, step.startedAt, step.endedAt));\n }, 1000);\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n\nconst useStepIconStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n color: theme.palette.text.disabled,\n display: 'flex',\n height: 22,\n alignItems: 'center',\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n }),\n);\n\nconst TaskStepIconComponent = ({ active, completed, error }: StepIconProps) => {\n const classes = useStepIconStyles();\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"24px\" />;\n }\n if (completed) {\n return <Check />;\n }\n if (error) {\n return <Cancel />;\n }\n return <FiberManualRecordIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n};\n\ntype TaskStatusStepperProps = {\n steps: TaskStep[];\n currentStepId: string | undefined;\n onUserStepChange: (id: string) => void;\n classes?: {\n root?: string;\n };\n};\n\nexport const TaskStatusStepper = memo((props: TaskStatusStepperProps) => {\n const { steps, currentStepId, onUserStepChange } = props;\n const classes = useStyles(props);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <div className={classes.root}>\n <Stepper\n activeStep={steps.findIndex(s => s.id === currentStepId)}\n orientation=\"vertical\"\n nonLinear\n >\n {steps.map((step, _) => {\n const isCancelled = step.status === ComputedStatus.Cancelled;\n const isActive = step.status === ComputedStatus.Running;\n const isCompleted = step.status === ComputedStatus.Succeeded;\n const isFailed = step.status === ComputedStatus.Failed;\n const isSkipped = step.status === ComputedStatus.Skipped;\n\n return (\n <Step key={step.id} expanded>\n <StepButton onClick={() => onUserStepChange(step.id)}>\n <StepLabel\n StepIconProps={{\n completed: isCompleted,\n error: isFailed || isCancelled,\n active: isActive,\n }}\n StepIconComponent={TaskStepIconComponent}\n className={classes.stepWrapper}\n >\n <div className={classes.labelWrapper}>\n <Typography variant=\"subtitle2\">{step.name}</Typography>\n {isSkipped ? (\n <Typography variant=\"caption\">\n {t('pipelineRunLogs.taskStatusStepper.skipped')}\n </Typography>\n ) : (\n <StepTimeTicker step={step} />\n )}\n </div>\n </StepLabel>\n </StepButton>\n </Step>\n );\n })}\n </Stepper>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAA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,UAAC,SAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAe;AAAA,cACb,SAAA,EAAW,WAAA;AAAA,cACX,OAAO,QAAA,IAAY,WAAA;AAAA,cACnB,MAAA,EAAQ;AAAA,aACV;AAAA,YACA,iBAAA,EAAmB,qBAAA;AAAA,YACnB,WAAW,OAAA,CAAQ,WAAA;AAAA,YAEnB,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,YAAA,EACtB,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,WAAA,EAAa,QAAA,EAAA,IAAA,CAAK,IAAA,EAAK,CAAA;AAAA,cAC1C,SAAA,mBACC,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EACjB,QAAA,EAAA,CAAA,CAAE,2CAA2C,CAAA,EAChD,CAAA,mBAEA,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAY;AAAA,aAAA,EAEhC;AAAA;AAAA,SACF,EACF,CAAA,EAAA,EAtBS,IAAA,CAAK,EAuBhB,CAAA;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"TaskStatusStepper.esm.js","sources":["../../../src/components/PipelineRunLogs/TaskStatusStepper.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, memo } from 'react';\nimport useInterval from 'react-use/lib/useInterval';\n\nimport {\n CircularProgress,\n createStyles,\n makeStyles,\n StepButton,\n StepIconProps,\n Theme,\n} from '@material-ui/core';\nimport Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport Cancel from '@material-ui/icons/Cancel';\nimport Check from '@material-ui/icons/Check';\nimport FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';\nimport classNames from 'classnames';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TaskStep } from '../../utils/taskRun-utils';\nimport { calculateDuration } from '../../utils/tekton-utils';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n },\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n labelWrapper: {\n display: 'flex',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n stepWrapper: {\n width: '100%',\n },\n }),\n);\n\nconst StepTimeTicker = ({ step }: { step: TaskStep }) => {\n const [time, setTime] = useState('');\n const { t } = useTranslationRef(tektonTranslationRef);\n\n useInterval(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n setTime(calculateDuration(t, step.startedAt, step.endedAt));\n }, 1000);\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n\nconst useStepIconStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n color: theme.palette.text.disabled,\n display: 'flex',\n height: 22,\n alignItems: 'center',\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n }),\n);\n\nconst TaskStepIconComponent = ({ active, completed, error }: StepIconProps) => {\n const classes = useStepIconStyles();\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"24px\" />;\n }\n if (completed) {\n return <Check />;\n }\n if (error) {\n return <Cancel />;\n }\n return <FiberManualRecordIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n};\n\ntype TaskStatusStepperProps = {\n steps: TaskStep[];\n currentStepId: string | undefined;\n onUserStepChange: (id: string) => void;\n classes?: {\n root?: string;\n };\n};\n\nexport const TaskStatusStepper = memo((props: TaskStatusStepperProps) => {\n const { steps, currentStepId, onUserStepChange } = props;\n const classes = useStyles(props);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <div className={classes.root}>\n <Stepper\n activeStep={steps.findIndex(s => s.id === currentStepId)}\n orientation=\"vertical\"\n nonLinear\n >\n {steps.map((step, _) => {\n const isCancelled = step.status === ComputedStatus.Cancelled;\n const isActive = step.status === ComputedStatus.Running;\n const isCompleted = step.status === ComputedStatus.Succeeded;\n const isFailed = step.status === ComputedStatus.Failed;\n const isSkipped = step.status === ComputedStatus.Skipped;\n\n return (\n <Step key={step.id} expanded>\n <StepButton onClick={() => onUserStepChange(step.id)}>\n <StepLabel\n StepIconProps={{\n completed: isCompleted,\n error: isFailed || isCancelled,\n active: isActive,\n }}\n StepIconComponent={TaskStepIconComponent}\n className={classes.stepWrapper}\n >\n <div className={classes.labelWrapper}>\n <Typography variant=\"subtitle2\">{step.name}</Typography>\n {isSkipped ? (\n <Typography variant=\"caption\">\n {t('pipelineRunLogs.taskStatusStepper.skipped')}\n </Typography>\n ) : (\n <StepTimeTicker step={step} />\n )}\n </div>\n </StepLabel>\n </StepButton>\n </Step>\n );\n })}\n </Stepper>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS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AAAA,cACnB,MAAA,EAAQ;AAAA,aACV;AAAA,YACA,iBAAA,EAAmB,qBAAA;AAAA,YACnB,WAAW,OAAA,CAAQ,WAAA;AAAA,YAEnB,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,YAAA,EACtB,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,WAAA,EAAa,QAAA,EAAA,IAAA,CAAK,IAAA,EAAK,CAAA;AAAA,cAC1C,SAAA,mBACC,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EACjB,QAAA,EAAA,CAAA,CAAE,2CAA2C,CAAA,EAChD,CAAA,mBAEA,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAY;AAAA,aAAA,EAEhC;AAAA;AAAA,SACF,EACF,CAAA,EAAA,EAtBS,IAAA,CAAK,EAuBhB,CAAA;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ,CAAC;;;;"}
@@ -7,7 +7,8 @@ import { tektonGroupColor } from '../../types/types.esm.js';
7
7
  import PipelineRunOutput from '../PipelineRunList/PipelineRunOutput.esm.js';
8
8
  import ResourceBadge from '../PipelineRunList/ResourceBadge.esm.js';
9
9
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
10
- import { tektonTranslationRef } from '../../translation.esm.js';
10
+ import '../../translations/index.esm.js';
11
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
11
12
 
12
13
  const useStyles = makeStyles(
13
14
  (theme) => createStyles({
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineRunOutputDialog.esm.js","sources":["../../../src/components/PipelineRunOutput/PipelineRunOutputDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { memo } from 'react';\n\nimport { ErrorBoundary } from '@backstage/core-components';\n\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport { PipelineRunKind, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { tektonGroupColor } from '../../types/types';\nimport PipelineRunOutput from '../PipelineRunList/PipelineRunOutput';\nimport ResourceBadge from '../PipelineRunList/ResourceBadge';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\ntype PipelineRunOutputDialogProps = {\n open: boolean;\n closeDialog: () => void;\n pipelineRun: PipelineRunKind;\n taskRuns: TaskRunKind[];\n};\nconst PipelineRunOutputDialog = ({\n open,\n closeDialog,\n pipelineRun,\n taskRuns,\n}: PipelineRunOutputDialogProps) => {\n const classes = useStyles();\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Dialog\n data-testid=\"pipelinerun-output-dialog\"\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n >\n <DialogTitle id=\"pipelinerun-output\" title={t('pipelineRunOutput.title')}>\n <Box className={classes.titleContainer}>\n <ResourceBadge\n color={tektonGroupColor}\n abbr=\"PLR\"\n name={pipelineRun?.metadata?.name ?? ''}\n />{' '}\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n </DialogTitle>\n <DialogContent>\n <ErrorBoundary>\n <PipelineRunOutput pipelineRun={pipelineRun} taskRuns={taskRuns} />\n </ErrorBoundary>\n </DialogContent>\n </Dialog>\n );\n};\n\nexport default memo(PipelineRunOutputDialog);\n"],"names":[],"mappings":";;;;;;;;;;;AAuCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KACtB;AAAA,IACA,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG;AAAA;AAC/B,GACD;AACH,CAAA;AAQA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAA,KAAoC;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,2BAAA;AAAA,MACZ,QAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAS,IAAA;AAAA,MACT,IAAA;AAAA,MACA,OAAA,EAAS,WAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,EAAA,EAAG,oBAAA,EAAqB,KAAA,EAAO,CAAA,CAAE,yBAAyB,CAAA,EACrE,QAAA,kBAAA,IAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EACtB,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,aAAA;AAAA,YAAA;AAAA,cACC,KAAA,EAAO,gBAAA;AAAA,cACP,IAAA,EAAK,KAAA;AAAA,cACL,IAAA,EAAM,WAAA,EAAa,QAAA,EAAU,IAAA,IAAQ;AAAA;AAAA,WACvC;AAAA,UAAG,GAAA;AAAA,0BACH,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,YAAA,EAAW,OAAA;AAAA,cACX,WAAW,OAAA,CAAQ,WAAA;AAAA,cACnB,OAAA,EAAS,WAAA;AAAA,cAET,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,SAAA,EACF,CAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EACC,8BAAC,iBAAA,EAAA,EAAkB,WAAA,EAA0B,QAAA,EAAoB,CAAA,EACnE,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;AAEA,gCAAe,KAAK,uBAAuB,CAAA;;;;"}
1
+ {"version":3,"file":"PipelineRunOutputDialog.esm.js","sources":["../../../src/components/PipelineRunOutput/PipelineRunOutputDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { memo } from 'react';\n\nimport { ErrorBoundary } from '@backstage/core-components';\n\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport { PipelineRunKind, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { tektonGroupColor } from '../../types/types';\nimport PipelineRunOutput from '../PipelineRunList/PipelineRunOutput';\nimport ResourceBadge from '../PipelineRunList/ResourceBadge';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\ntype PipelineRunOutputDialogProps = {\n open: boolean;\n closeDialog: () => void;\n pipelineRun: PipelineRunKind;\n taskRuns: TaskRunKind[];\n};\nconst PipelineRunOutputDialog = ({\n open,\n closeDialog,\n pipelineRun,\n taskRuns,\n}: PipelineRunOutputDialogProps) => {\n const classes = useStyles();\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Dialog\n data-testid=\"pipelinerun-output-dialog\"\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n >\n <DialogTitle id=\"pipelinerun-output\" title={t('pipelineRunOutput.title')}>\n <Box className={classes.titleContainer}>\n <ResourceBadge\n color={tektonGroupColor}\n abbr=\"PLR\"\n name={pipelineRun?.metadata?.name ?? ''}\n />{' '}\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n </DialogTitle>\n <DialogContent>\n <ErrorBoundary>\n <PipelineRunOutput pipelineRun={pipelineRun} taskRuns={taskRuns} />\n </ErrorBoundary>\n </DialogContent>\n </Dialog>\n );\n};\n\nexport default memo(PipelineRunOutputDialog);\n"],"names":[],"mappings":";;;;;;;;;;;;AAuCA,MAAM,S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A,EAAM,WAAA,EAAa,QAAA,EAAU,IAAA,IAAQ;AAAA;AAAA,WACvC;AAAA,UAAG,GAAA;AAAA,0BACH,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,YAAA,EAAW,OAAA;AAAA,cACX,WAAW,OAAA,CAAQ,WAAA;AAAA,cACnB,OAAA,EAAS,WAAA;AAAA,cAET,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,SAAA,EACF,CAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EACC,8BAAC,iBAAA,EAAA,EAAkB,WAAA,EAA0B,QAAA,EAAoB,CAAA,EACnE,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;AAEA,gCAAe,KAAK,uBAAuB,CAAA;;;;"}
@@ -3,7 +3,8 @@ import { WarningPanel } from '@backstage/core-components';
3
3
  import { useEntity } from '@backstage/plugin-catalog-react';
4
4
  import { Typography } from '@material-ui/core';
5
5
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
- import { tektonTranslationRef } from '../../translation.esm.js';
6
+ import '../../translations/index.esm.js';
7
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
7
8
 
8
9
  const ErrorPanel = ({ allErrors }) => {
9
10
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorPanel.esm.js","sources":["../../../src/components/common/ErrorPanel.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WarningPanel } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { Typography } from '@material-ui/core';\n\nimport { ClusterError, ClusterErrors } from '../../types/types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype ErrorPanelProps = { allErrors: ClusterErrors };\n\nexport const ErrorPanel = ({ allErrors }: ErrorPanelProps) => {\n const {\n entity: {\n metadata: { name: entityName },\n },\n } = useEntity();\n const { t } = useTranslationRef(tektonTranslationRef);\n return (\n <div className=\"warning-panel\" style={{ marginBottom: '16px' }}>\n <WarningPanel\n title={t('errorPanel.title')}\n message={t('errorPanel.description', {\n entityName,\n })}\n >\n <div>\n Errors:\n {allErrors.map((err: ClusterError, _index) => {\n const errMessage = err.message\n ? `${err.message}`\n : `Error fetching Kubernetes resource: '${err.resourcePath}', error: ${err.errorType}, status code: ${err.statusCode}`;\n return (\n <Typography\n variant=\"body2\"\n key={`${err.resourcePath}-${err.statusCode}`}\n >\n {err.errorType === 'FETCH_ERROR'\n ? `Error communicating with Kubernetes: ${err.errorType}, message: ${err.message}`\n : errMessage}\n </Typography>\n );\n })}\n </div>\n </WarningPanel>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,UAAA,GAAa,CAAC,EAAE,SAAA,EAAU,KAAuB;AAC5D,EAAA,MAAM;AAAA,IACJ,MAAA,EAAQ;AAAA,MACN,QAAA,EAAU,EAAE,IAAA,EAAM,UAAA;AAAW;AAC/B,MACE,SAAA,EAAU;AACd,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,uBACE,GAAA,CAAC,SAAI,SAAA,EAAU,eAAA,EAAgB,OAAO,EAAE,YAAA,EAAc,QAAO,EAC3D,QAAA,kBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,MAC3B,OAAA,EAAS,EAAE,wBAAA,EAA0B;AAAA,QACnC;AAAA,OACD,CAAA;AAAA,MAED,+BAAC,KAAA,EAAA,EAAI,QAAA,EAAA;AAAA,QAAA,SAAA;AAAA,QAEF,SAAA,CAAU,GAAA,CAAI,CAAC,GAAA,EAAmB,MAAA,KAAW;AAC5C,UAAA,MAAM,UAAA,GAAa,GAAA,CAAI,OAAA,GACnB,CAAA,EAAG,IAAI,OAAO,CAAA,CAAA,GACd,CAAA,qCAAA,EAAwC,GAAA,CAAI,YAAY,CAAA,UAAA,EAAa,GAAA,CAAI,SAAS,CAAA,eAAA,EAAkB,IAAI,UAAU,CAAA,CAAA;AACtH,UAAA,uBACE,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,OAAA;AAAA,cAGP,QAAA,EAAA,GAAA,CAAI,cAAc,aAAA,GACf,CAAA,qCAAA,EAAwC,IAAI,SAAS,CAAA,WAAA,EAAc,GAAA,CAAI,OAAO,CAAA,CAAA,GAC9E;AAAA,aAAA;AAAA,YAJC,CAAA,EAAG,GAAA,CAAI,YAAY,CAAA,CAAA,EAAI,IAAI,UAAU,CAAA;AAAA,WAK5C;AAAA,QAEJ,CAAC;AAAA,OAAA,EACH;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ErrorPanel.esm.js","sources":["../../../src/components/common/ErrorPanel.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WarningPanel } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { Typography } from '@material-ui/core';\n\nimport { ClusterError, ClusterErrors } from '../../types/types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype ErrorPanelProps = { allErrors: ClusterErrors };\n\nexport const ErrorPanel = ({ allErrors }: ErrorPanelProps) => {\n const {\n entity: {\n metadata: { name: entityName },\n },\n } = useEntity();\n const { t } = useTranslationRef(tektonTranslationRef);\n return (\n <div className=\"warning-panel\" style={{ marginBottom: '16px' }}>\n <WarningPanel\n title={t('errorPanel.title')}\n message={t('errorPanel.description', {\n entityName,\n })}\n >\n <div>\n Errors:\n {allErrors.map((err: ClusterError, _index) => {\n const errMessage = err.message\n ? `${err.message}`\n : `Error fetching Kubernetes resource: '${err.resourcePath}', error: ${err.errorType}, status code: ${err.statusCode}`;\n return (\n <Typography\n variant=\"body2\"\n key={`${err.resourcePath}-${err.statusCode}`}\n >\n {err.errorType === 'FETCH_ERROR'\n ? `Error communicating with Kubernetes: ${err.errorType}, message: ${err.message}`\n : errMessage}\n </Typography>\n );\n })}\n </div>\n </WarningPanel>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0BO,MAAM,UAAA,GAAa,CAAC,EAAE,SAAA,EAAU,KAAuB;AAC5D,EAAA,MAAM;AAAA,IACJ,MAAA,EAAQ;AAAA,MACN,QAAA,EAAU,EAAE,IAAA,EAAM,UAAA;AAAW;AAC/B,MACE,SAAA,EAAU;AACd,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,uBACE,GAAA,CAAC,SAAI,SAAA,EAAU,eAAA,EAAgB,OAAO,EAAE,YAAA,EAAc,QAAO,EAC3D,QAAA,kBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,MAC3B,OAAA,EAAS,EAAE,wBAAA,EAA0B;AAAA,QACnC;AAAA,OACD,CAAA;AAAA,MAED,+BAAC,KAAA,EAAA,EAAI,QAAA,EAAA;AAAA,QAAA,SAAA;AAAA,QAEF,SAAA,CAAU,GAAA,CAAI,CAAC,GAAA,EAAmB,MAAA,KAAW;AAC5C,UAAA,MAAM,UAAA,GAAa,GAAA,CAAI,OAAA,GACnB,CAAA,EAAG,IAAI,OAAO,CAAA,CAAA,GACd,CAAA,qCAAA,EAAwC,GAAA,CAAI,YAAY,CAAA,UAAA,EAAa,GAAA,CAAI,SAAS,CAAA,eAAA,EAAkB,IAAI,UAAU,CAAA,CAAA;AACtH,UAAA,uBACE,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,OAAA;AAAA,cAGP,QAAA,EAAA,GAAA,CAAI,cAAc,aAAA,GACf,CAAA,qCAAA,EAAwC,IAAI,SAAS,CAAA,WAAA,EAAc,GAAA,CAAI,OAAO,CAAA,CAAA,GAC9E;AAAA,aAAA;AAAA,YAJC,CAAA,EAAG,GAAA,CAAI,YAAY,CAAA,CAAA,EAAI,IAAI,UAAU,CAAA;AAAA,WAK5C;AAAA,QAEJ,CAAC;AAAA,OAAA,EACH;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
@@ -2,7 +2,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Alert, AlertTitle } from '@material-ui/lab';
3
3
  import { kubernetesClustersReadPermission, kubernetesResourcesReadPermission } from '@backstage/plugin-kubernetes-common';
4
4
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
- import { tektonTranslationRef } from '../../translation.esm.js';
5
+ import '../../translations/index.esm.js';
6
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
6
7
 
7
8
  const permissions = [
8
9
  kubernetesClustersReadPermission,
@@ -1 +1 @@
1
- {"version":3,"file":"PermissionAlert.esm.js","sources":["../../../src/components/common/PermissionAlert.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Alert, AlertTitle } from '@material-ui/lab';\nimport {\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n} from '@backstage/plugin-kubernetes-common';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nconst permissions = [\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n]\n .map(p => p.name)\n .join(', ');\n\nconst PermissionAlert = () => {\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Alert severity=\"warning\" data-testid=\"no-permission-alert\">\n <AlertTitle>{t('permissionAlert.title')}</AlertTitle>\n {t('permissionAlert.description', { permissions })}\n </Alert>\n );\n};\nexport default PermissionAlert;\n"],"names":[],"mappings":";;;;;;AAuBA,MAAM,WAAA,GAAc;AAAA,EAClB,gCAAA;AAAA,EACA;AACF,CAAA,CACG,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAI,CAAA,CACf,KAAK,IAAI,CAAA;AAEZ,MAAM,kBAAkB,MAAM;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,SAAA,EAAU,eAAY,qBAAA,EACpC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAY,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAAE,CAAA;AAAA,IACvC,CAAA,CAAE,6BAAA,EAA+B,EAAE,WAAA,EAAa;AAAA,GAAA,EACnD,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PermissionAlert.esm.js","sources":["../../../src/components/common/PermissionAlert.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Alert, AlertTitle } from '@material-ui/lab';\nimport {\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n} from '@backstage/plugin-kubernetes-common';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst permissions = [\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n]\n .map(p => p.name)\n .join(', ');\n\nconst PermissionAlert = () => {\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Alert severity=\"warning\" data-testid=\"no-permission-alert\">\n <AlertTitle>{t('permissionAlert.title')}</AlertTitle>\n {t('permissionAlert.description', { permissions })}\n </Alert>\n );\n};\nexport default PermissionAlert;\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,WAAA,GAAc;AAAA,EAClB,gCAAA;AAAA,EACA;AACF,CAAA,CACG,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAI,CAAA,CACf,KAAK,IAAI,CAAA;AAEZ,MAAM,kBAAkB,MAAM;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,SAAA,EAAU,eAAY,qBAAA,EACpC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAY,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAAE,CAAA;AAAA,IACvC,CAAA,CAAE,6BAAA,EAA+B,EAAE,WAAA,EAAa;AAAA,GAAA,EACnD,CAAA;AAEJ;;;;"}
@@ -6,7 +6,8 @@ import './StatusSelector.css.esm.js';
6
6
  import { ComputedStatus } from '@janus-idp/shared-react';
7
7
  import { TektonResourcesContext } from '../../hooks/TektonResourcesContext.esm.js';
8
8
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
9
- import { tektonTranslationRef } from '../../translation.esm.js';
9
+ import '../../translations/index.esm.js';
10
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
10
11
 
11
12
  const useStyles = makeStyles((theme) => ({
12
13
  label: {
@@ -1 +1 @@
1
- {"version":3,"file":"StatusSelector.esm.js","sources":["../../../src/components/common/StatusSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\n\nimport { makeStyles, Theme, Typography } from '@material-ui/core';\n\nimport './StatusSelector.css';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles<Theme>(theme => ({\n label: {\n color: theme.palette.text.primary,\n fontSize: '1rem',\n paddingRight: '10px',\n fontWeight: 'bold',\n },\n}));\n\nexport const StatusSelector = () => {\n const classes = useStyles();\n const { selectedStatus, setSelectedStatus } = useContext(\n TektonResourcesContext,\n );\n\n const onStatusChange = (status: SelectedItems) => {\n setSelectedStatus(status as ComputedStatus);\n };\n const { t } = useTranslationRef(tektonTranslationRef);\n const statusOptions = Object.entries(ComputedStatus)\n .sort(([keyA], [keyB]) => {\n if (keyA === keyB) {\n return 0;\n } else if (keyA < keyB) {\n return -1;\n }\n return 1;\n })\n .map(([key, value]) => ({\n value: key,\n label: t(`pipelineRunStatus.${key}` as any, { defaultValue: value }),\n }));\n\n return (\n <div className=\"bs-tkn-status-selector\">\n <Typography className={classes.label}>\n {t('statusSelector.label')}\n </Typography>\n <Select\n onChange={onStatusChange}\n label=\"\"\n items={statusOptions}\n selected={selectedStatus}\n margin=\"dense\"\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAkB,CAAA,KAAA,MAAU;AAAA,EAC5C,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAA;AAAA,IACV,YAAA,EAAc,MAAA;AAAA,IACd,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAEK,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAkB,GAAI,UAAA;AAAA,IAC5C;AAAA,GACF;AAEA,EAAA,MAAM,cAAA,GAAiB,CAAC,MAAA,KAA0B;AAChD,IAAA,iBAAA,CAAkB,MAAwB,CAAA;AAAA,EAC5C,CAAA;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,aAAA,GAAgB,MAAA,CAAO,OAAA,CAAQ,cAAc,CAAA,CAChD,IAAA,CAAK,CAAC,CAAC,IAAI,CAAA,EAAG,CAAC,IAAI,CAAA,KAAM;AACxB,IAAA,IAAI,SAAS,IAAA,EAAM;AACjB,MAAA,OAAO,CAAA;AAAA,IACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACtB,MAAA,OAAO,EAAA;AAAA,IACT;AACA,IAAA,OAAO,CAAA;AAAA,EACT,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,MAAO;AAAA,IACtB,KAAA,EAAO,GAAA;AAAA,IACP,KAAA,EAAO,EAAE,CAAA,kBAAA,EAAqB,GAAG,IAAW,EAAE,YAAA,EAAc,OAAO;AAAA,GACrE,CAAE,CAAA;AAEJ,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wBAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,SAAA,EAAW,OAAA,CAAQ,KAAA,EAC5B,QAAA,EAAA,CAAA,CAAE,sBAAsB,CAAA,EAC3B,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAU,cAAA;AAAA,QACV,KAAA,EAAM,EAAA;AAAA,QACN,KAAA,EAAO,aAAA;AAAA,QACP,QAAA,EAAU,cAAA;AAAA,QACV,MAAA,EAAO;AAAA;AAAA;AACT,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"StatusSelector.esm.js","sources":["../../../src/components/common/StatusSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\n\nimport { makeStyles, Theme, Typography } from '@material-ui/core';\n\nimport './StatusSelector.css';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles<Theme>(theme => ({\n label: {\n color: theme.palette.text.primary,\n fontSize: '1rem',\n paddingRight: '10px',\n fontWeight: 'bold',\n },\n}));\n\nexport const StatusSelector = () => {\n const classes = useStyles();\n const { selectedStatus, setSelectedStatus } = useContext(\n TektonResourcesContext,\n );\n\n const onStatusChange = (status: SelectedItems) => {\n setSelectedStatus(status as ComputedStatus);\n };\n const { t } = useTranslationRef(tektonTranslationRef);\n const statusOptions = Object.entries(ComputedStatus)\n .sort(([keyA], [keyB]) => {\n if (keyA === keyB) {\n return 0;\n } else if (keyA < keyB) {\n return -1;\n }\n return 1;\n })\n .map(([key, value]) => ({\n value: key,\n label: t(`pipelineRunStatus.${key}` as any, { defaultValue: value }),\n }));\n\n return (\n <div className=\"bs-tkn-status-selector\">\n <Typography className={classes.label}>\n {t('statusSelector.label')}\n </Typography>\n <Select\n onChange={onStatusChange}\n label=\"\"\n items={statusOptions}\n selected={selectedStatus}\n margin=\"dense\"\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAkB,CAAA,KAAA,MAAU;AAAA,EAC5C,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAA;AAAA,IACV,YAAA,EAAc,MAAA;AAAA,IACd,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAEK,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAkB,GAAI,UAAA;AAAA,IAC5C;AAAA,GACF;AAEA,E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{ TektonResourcesContext } from '../../hooks/TektonResourcesContext.esm.js';
7
7
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
8
- import { tektonTranslationRef } from '../../translation.esm.js';
8
+ import '../../translations/index.esm.js';
9
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
9
10
 
10
11
  const useStyles = makeStyles({
11
12
  expandCollapse: {
@@ -1 +1 @@
1
- {"version":3,"file":"TableExpandCollapse.esm.js","sources":["../../../src/components/common/TableExpandCollapse.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { IconButton, makeStyles, Tooltip } from '@material-ui/core';\nimport Collapse from '@material-ui/icons/UnfoldLess';\nimport Expand from '@material-ui/icons/UnfoldMore';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles({\n expandCollapse: {\n flexGrow: 1,\n textAlign: 'end',\n },\n iconButton: {\n padding: '2px',\n },\n});\n\nexport const TableExpandCollapse = () => {\n const classes = useStyles();\n const { isExpanded, setIsExpanded } = useContext(TektonResourcesContext);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const handleExpandCollaspse = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n <div className={classes.expandCollapse}>\n <Tooltip title={t('tableExpandCollapse.collapseAll')} placement=\"top\">\n <span>\n <IconButton\n onClick={() => handleExpandCollaspse()}\n disabled={!isExpanded}\n className={classes.iconButton}\n >\n <Collapse />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t('tableExpandCollapse.expandAll')} placement=\"top\">\n <span>\n <IconButton\n onClick={() => handleExpandCollaspse()}\n disabled={isExpanded}\n className={classes.iconButton}\n >\n <Expand />\n </IconButton>\n </span>\n </Tooltip>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,cAAA,EAAgB;AAAA,IACd,QAAA,EAAU,CAAA;AAAA,IACV,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS;AAAA;AAEb,CAAC,CAAA;AAEM,MAAM,sBAAsB,MAAM;AACvC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,UAAA,EAAY,aAAA,EAAc,GAAI,WAAW,sBAAsB,CAAA;AACvE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,wBAAwB,MAAM;AAClC,IAAA,aAAA,CAAc,CAAC,UAAU,CAAA;AAAA,EAC3B,CAAA;AACA,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EACtB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,OAAA,EAAA,EAAQ,OAAO,CAAA,CAAE,iCAAiC,GAAG,SAAA,EAAU,KAAA,EAC9D,8BAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,MAAM,qBAAA,EAAsB;AAAA,QACrC,UAAU,CAAC,UAAA;AAAA,QACX,WAAW,OAAA,CAAQ,UAAA;AAAA,QAEnB,8BAAC,QAAA,EAAA,EAAS;AAAA;AAAA,OAEd,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,WAAQ,KAAA,EAAO,CAAA,CAAE,+BAA+B,CAAA,EAAG,SAAA,EAAU,KAAA,EAC5D,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,MAAM,qBAAA,EAAsB;AAAA,QACrC,QAAA,EAAU,UAAA;AAAA,QACV,WAAW,OAAA,CAAQ,UAAA;AAAA,QAEnB,8BAAC,MAAA,EAAA,EAAO;AAAA;AAAA,OAEZ,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TableExpandCollapse.esm.js","sources":["../../../src/components/common/TableExpandCollapse.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { IconButton, makeStyles, Tooltip } from '@material-ui/core';\nimport Collapse from '@material-ui/icons/UnfoldLess';\nimport Expand from '@material-ui/icons/UnfoldMore';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles({\n expandCollapse: {\n flexGrow: 1,\n textAlign: 'end',\n },\n iconButton: {\n padding: '2px',\n },\n});\n\nexport const TableExpandCollapse = () => {\n const classes = useStyles();\n const { isExpanded, setIsExpanded } = useContext(TektonResourcesContext);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const handleExpandCollaspse = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n <div className={classes.expandCollapse}>\n <Tooltip title={t('tableExpandCollapse.collapseAll')} placement=\"top\">\n <span>\n <IconButton\n onClick={() => handleExpandCollaspse()}\n disabled={!isExpanded}\n className={classes.iconButton}\n >\n <Collapse />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t('tableExpandCollapse.expandAll')} placement=\"top\">\n <span>\n <IconButton\n onClick={() => handleExpandCollaspse()}\n disabled={isExpanded}\n className={classes.iconButton}\n >\n <Expand />\n </IconButton>\n </span>\n </Tooltip>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,cAAA,EAAgB;AAAA,IACd,QAAA,EAAU,CAAA;AAAA,IACV,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS;AAAA;AAEb,CAAC,CAAA;AAEM,MAAM,sBAAsB,MAAM;AACvC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,UAAA,EAAY,aAAA,EAAc,GAAI,WAAW,sBAAsB,CAAA;AACvE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,wBAAwB,MAAM;AAClC,IAAA,aAAA,CAAc,CAAC,UAAU,CAAA;AAAA,EAC3B,CAAA;AACA,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EACtB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,OAAA,EAAA,EAAQ,OAAO,CAAA,CAAE,iCAAiC,GAAG,SAAA,EAAU,KAAA,EAC9D,8BAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,MAAM,qBAAA,EAAsB;AAAA,QACrC,UAAU,CAAC,UAAA;AAAA,QACX,WAAW,OAAA,CAAQ,UAAA;AAAA,QAEnB,8BAAC,QAAA,EAAA,EAAS;AAAA;AAAA,OAEd,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,WAAQ,KAAA,EAAO,CAAA,CAAE,+BAA+B,CAAA,EAAG,SAAA,EAAU,KAAA,EAC5D,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,MAAM,qBAAA,EAAsB;AAAA,QACrC,QAAA,EAAU,UAAA;AAAA,QACV,WAAW,OAAA,CAAQ,UAAA;AAAA,QAEnB,8BAAC,MAAA,EAAA,EAAO;AAAA;AAAA,OAEZ,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -12,7 +12,8 @@ import PipelineRunLogDialog from '../PipelineRunLogs/PipelineRunLogDialog.esm.js
12
12
  import { PipelineVisualizationStepList } from './PipelineVisualizationStepList.esm.js';
13
13
  import './PipelineTaskNode.css.esm.js';
14
14
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
15
- import { tektonTranslationRef } from '../../translation.esm.js';
15
+ import '../../translations/index.esm.js';
16
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
16
17
 
17
18
  const PipelineTaskNode = ({
18
19
  element,
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineTaskNode.esm.js","sources":["../../../src/components/pipeline-topology/PipelineTaskNode.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { LegacyRef } from 'react';\n\nimport { useState, useContext, useRef, useMemo, memo } from 'react';\n\nimport { Tooltip } from '@patternfly/react-core';\nimport {\n DEFAULT_LAYER,\n DEFAULT_WHEN_OFFSET,\n GraphElement,\n Layer,\n Node,\n RunStatus,\n ScaleDetailsLevel,\n TaskNode,\n TOP_LAYER,\n useDetailsLevel,\n useHover,\n WhenDecorator,\n WithContextMenuProps,\n WithSelectionProps,\n} from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport { PipelineTaskWithStatus, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { NodeType } from '../../consts/pipeline-topology-const';\nimport {\n TEKTON_PIPELINE_RUN,\n TEKTON_PIPELINE_TASK,\n} from '../../consts/tekton-const';\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { StepStatus } from '../../types/taskRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { createStepStatus } from '../../utils/pipeline-step-utils';\nimport { getTaskStatus } from '../../utils/pipelineRun-utils';\nimport PipelineRunLogDialog from '../PipelineRunLogs/PipelineRunLogDialog';\nimport { PipelineVisualizationStepList } from './PipelineVisualizationStepList';\n\nimport './PipelineTaskNode.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype PipelineTaskNodeProps = {\n element: Node;\n} & WithContextMenuProps &\n WithSelectionProps &\n GraphElement;\n\nconst PipelineTaskNode = ({\n element,\n onContextMenu,\n contextMenuOpen,\n ...rest\n}: PipelineTaskNodeProps) => {\n const [open, setOpen] = useState<boolean>(false);\n const { watchResourcesData } = useContext<TektonResourcesContextData>(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n const data = element.getData();\n const triggerRef = useRef<SVGGElement | null>(null);\n\n const pipelineRun = data.pipelineRun;\n const [hover, hoverRef] = useHover();\n const detailsLevel = useDetailsLevel();\n const isFinallyTask = element.getType() === NodeType.FINALLY_NODE;\n\n const pods = watchResourcesData?.pods?.data || [];\n const taskRuns = watchResourcesData?.taskruns?.data || [];\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const computedTask: PipelineTaskWithStatus = data.task;\n const stepList =\n computedTask?.status?.steps || computedTask?.taskSpec?.steps || [];\n\n const taskStatus = getTaskStatus(data.pipelineRun, data.task);\n\n const stepStatusList: StepStatus[] = stepList.map((step: { name: string }) =>\n createStepStatus(step, taskStatus, t),\n );\n const succeededStepsCount = stepStatusList.filter(\n ({ status }) => status === RunStatus.Succeeded,\n ).length;\n\n const badge =\n stepStatusList.length > 0 && data.status\n ? `${succeededStepsCount}/${stepStatusList.length}`\n : null;\n\n const passedData = useMemo(() => {\n const newData = { ...data };\n Object.keys(newData).forEach(key => {\n if (newData[key] === undefined) {\n delete newData[key];\n }\n });\n return newData;\n }, [data]);\n\n const hasTaskIcon = !!(data.taskIconClass || data.taskIcon);\n const whenDecorator = data.whenStatus ? (\n <WhenDecorator\n element={element}\n status={data.whenStatus}\n leftOffset={\n hasTaskIcon\n ? DEFAULT_WHEN_OFFSET + (element.getBounds().height - 4) * 0.75\n : DEFAULT_WHEN_OFFSET\n }\n />\n ) : null;\n const activeTaskId = taskRuns.find(\n (tr: TaskRunKind) =>\n tr?.metadata?.labels?.[TEKTON_PIPELINE_RUN] ===\n pipelineRun?.metadata?.name &&\n tr?.metadata?.labels?.[TEKTON_PIPELINE_TASK] === data.task?.name,\n )?.metadata?.name;\n\n const taskNode = (\n <>\n <PipelineRunLogDialog\n pipelineRun={pipelineRun}\n open={open}\n closeDialog={closeDialog}\n pods={pods}\n taskRuns={taskRuns}\n activeTask={activeTaskId}\n />\n <TaskNode\n className=\"bs-tkn-pipeline-task-node\"\n element={element}\n onContextMenu={data.showContextMenu ? onContextMenu : undefined}\n contextMenuOpen={contextMenuOpen}\n scaleNode={\n (hover || contextMenuOpen) && detailsLevel !== ScaleDetailsLevel.high\n }\n hideDetailsAtMedium\n {...passedData}\n {...rest}\n badge={badge}\n truncateLength={element.getData()?.label?.length}\n onSelect={activeTaskId && openDialog}\n >\n {whenDecorator}\n </TaskNode>\n </>\n );\n\n return (\n <Layer\n id={\n detailsLevel !== ScaleDetailsLevel.high && (hover || contextMenuOpen)\n ? TOP_LAYER\n : DEFAULT_LAYER\n }\n >\n <g\n data-test={`task ${element.getLabel()}`}\n className=\"bs-tkn-pipeline-task-node\"\n ref={hoverRef as LegacyRef<SVGGElement>}\n >\n <Tooltip\n position=\"bottom\"\n enableFlip={false}\n content={\n <PipelineVisualizationStepList\n isSpecOverview={!data.status}\n taskName={element.getLabel()}\n steps={stepStatusList}\n isFinallyTask={isFinallyTask}\n />\n }\n triggerRef={triggerRef}\n >\n <g ref={triggerRef}>{taskNode}</g>\n </Tooltip>\n </g>\n </Layer>\n );\n};\n\nexport default memo(observer(PipelineTaskNode));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgEA,MAAM,mBAAmB,CAAC;AAAA,EACxB,OAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC/C,EAAA,MAAM,EAAE,oBAAmB,GAAI,UAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,IAAA,GAAO,QAAQ,OAAA,EAAQ;AAC7B,EAAA,MAAM,UAAA,GAAa,OAA2B,IAAI,CAAA;AAElD,EAAA,MAAM,cAAc,IAAA,CAAK,WAAA;AACzB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,QAAA,EAAS;AACnC,EAAA,MAAM,eAAe,eAAA,EAAgB;AACrC,EAAA,MAAM,aAAA,GAAgB,OAAA,CAAQ,OAAA,EAAQ,KAAM,QAAA,CAAS,YAAA;AAErD,EAAA,MAAM,IAAA,GAAO,kBAAA,EAAoB,IAAA,EAAM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x"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { LegacyRef } from 'react';\n\nimport { useState, useContext, useRef, useMemo, memo } from 'react';\n\nimport { Tooltip } from '@patternfly/react-core';\nimport {\n DEFAULT_LAYER,\n DEFAULT_WHEN_OFFSET,\n GraphElement,\n Layer,\n Node,\n RunStatus,\n ScaleDetailsLevel,\n TaskNode,\n TOP_LAYER,\n useDetailsLevel,\n useHover,\n WhenDecorator,\n WithContextMenuProps,\n WithSelectionProps,\n} from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport { PipelineTaskWithStatus, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { NodeType } from '../../consts/pipeline-topology-const';\nimport {\n TEKTON_PIPELINE_RUN,\n TEKTON_PIPELINE_TASK,\n} from '../../consts/tekton-const';\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { StepStatus } from '../../types/taskRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { createStepStatus } from '../../utils/pipeline-step-utils';\nimport { getTaskStatus } from '../../utils/pipelineRun-utils';\nimport PipelineRunLogDialog from '../PipelineRunLogs/PipelineRunLogDialog';\nimport { PipelineVisualizationStepList } from './PipelineVisualizationStepList';\n\nimport './PipelineTaskNode.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineTaskNodeProps = {\n element: Node;\n} & WithContextMenuProps &\n WithSelectionProps &\n GraphElement;\n\nconst PipelineTaskNode = ({\n element,\n onContextMenu,\n contextMenuOpen,\n ...rest\n}: PipelineTaskNodeProps) => {\n const [open, setOpen] = useState<boolean>(false);\n const { watchResourcesData } = useContext<TektonResourcesContextData>(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n const data = element.getData();\n const triggerRef = useRef<SVGGElement | null>(null);\n\n const pipelineRun = data.pipelineRun;\n const [hover, hoverRef] = useHover();\n const detailsLevel = useDetailsLevel();\n const isFinallyTask = element.getType() === NodeType.FINALLY_NODE;\n\n const pods = watchResourcesData?.pods?.data || [];\n const taskRuns = watchResourcesData?.taskruns?.data || [];\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const computedTask: PipelineTaskWithStatus = data.task;\n const stepList =\n computedTask?.status?.steps || computedTask?.taskSpec?.steps || [];\n\n const taskStatus = getTaskStatus(data.pipelineRun, data.task);\n\n const stepStatusList: StepStatus[] = stepList.map((step: { name: string }) =>\n createStepStatus(step, taskStatus, t),\n );\n const succeededStepsCount = stepStatusList.filter(\n ({ status }) => status === RunStatus.Succeeded,\n ).length;\n\n const badge =\n stepStatusList.length > 0 && data.status\n ? `${succeededStepsCount}/${stepStatusList.length}`\n : null;\n\n const passedData = useMemo(() => {\n const newData = { ...data };\n Object.keys(newData).forEach(key => {\n if (newData[key] === undefined) {\n delete newData[key];\n }\n });\n return newData;\n }, [data]);\n\n const hasTaskIcon = !!(data.taskIconClass || data.taskIcon);\n const whenDecorator = data.whenStatus ? (\n <WhenDecorator\n element={element}\n status={data.whenStatus}\n leftOffset={\n hasTaskIcon\n ? DEFAULT_WHEN_OFFSET + (element.getBounds().height - 4) * 0.75\n : DEFAULT_WHEN_OFFSET\n }\n />\n ) : null;\n const activeTaskId = taskRuns.find(\n (tr: TaskRunKind) =>\n tr?.metadata?.labels?.[TEKTON_PIPELINE_RUN] ===\n pipelineRun?.metadata?.name &&\n tr?.metadata?.labels?.[TEKTON_PIPELINE_TASK] === data.task?.name,\n )?.metadata?.name;\n\n const taskNode = (\n <>\n <PipelineRunLogDialog\n pipelineRun={pipelineRun}\n open={open}\n closeDialog={closeDialog}\n pods={pods}\n taskRuns={taskRuns}\n activeTask={activeTaskId}\n />\n <TaskNode\n className=\"bs-tkn-pipeline-task-node\"\n element={element}\n onContextMenu={data.showContextMenu ? onContextMenu : undefined}\n contextMenuOpen={contextMenuOpen}\n scaleNode={\n (hover || contextMenuOpen) && detailsLevel !== ScaleDetailsLevel.high\n }\n hideDetailsAtMedium\n {...passedData}\n {...rest}\n badge={badge}\n truncateLength={element.getData()?.label?.length}\n onSelect={activeTaskId && openDialog}\n >\n {whenDecorator}\n </TaskNode>\n </>\n );\n\n return (\n <Layer\n id={\n detailsLevel !== ScaleDetailsLevel.high && (hover || contextMenuOpen)\n ? TOP_LAYER\n : DEFAULT_LAYER\n }\n >\n <g\n data-test={`task ${element.getLabel()}`}\n className=\"bs-tkn-pipeline-task-node\"\n ref={hoverRef as LegacyRef<SVGGElement>}\n >\n <Tooltip\n position=\"bottom\"\n enableFlip={false}\n content={\n <PipelineVisualizationStepList\n isSpecOverview={!data.status}\n taskName={element.getLabel()}\n steps={stepStatusList}\n isFinallyTask={isFinallyTask}\n />\n }\n triggerRef={triggerRef}\n >\n <g ref={triggerRef}>{taskNode}</g>\n </Tooltip>\n </g>\n </Layer>\n );\n};\n\nexport default memo(observer(PipelineTaskNode));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgEA,MAAM,mBAAmB,CAAC;AAAA,EACxB,OAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC/C,EAAA,MAAM,EAAE,oBAAmB,GAAI,UAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAA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,QAAA,EAAS;AAAA,kBAC3B,KAAA,EAAO,cAAA;AAAA,kBACP;AAAA;AAAA,eACF;AAAA,cAEF,UAAA;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAE,GAAA,EAAK,UAAA,EAAa,QAAA,EAAA,QAAA,EAAS;AAAA;AAAA;AAChC;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEA,yBAAe,IAAA,CAAK,QAAA,CAAS,gBAAgB,CAAC,CAAA;;;;"}
@@ -4,7 +4,8 @@ import { getGraphDataModel } from '../../utils/pipeline-topology-utils.esm.js';
4
4
  import { PipelineLayout } from './PipelineLayout.esm.js';
5
5
  import './PipelineVisualization.css.esm.js';
6
6
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
7
- import { tektonTranslationRef } from '../../translation.esm.js';
7
+ import '../../translations/index.esm.js';
8
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
8
9
 
9
10
  const PipelineVisualization = ({
10
11
  pipelineRun,
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualization.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PipelineRunKind, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { getGraphDataModel } from '../../utils/pipeline-topology-utils';\nimport { PipelineLayout } from './PipelineLayout';\n\nimport './PipelineVisualization.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype PipelineVisualizationProps = {\n pipelineRun: PipelineRunKind | null;\n taskRuns: TaskRunKind[];\n};\n\nexport const PipelineVisualization = ({\n pipelineRun,\n taskRuns,\n}: PipelineVisualizationProps) => {\n useDarkTheme();\n\n const model = getGraphDataModel(pipelineRun ?? undefined, taskRuns ?? []);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <>\n {!model || (model.nodes.length === 0 && model.edges.length === 0) ? (\n <div data-testid=\"pipeline-no-tasks\">\n {t('pipelineVisualization.noTasksDescription')}\n </div>\n ) : (\n <div\n data-testid=\"pipelineRun-visualization\"\n className=\"bs-tkn-pipeline-visualization__layout\"\n >\n <PipelineLayout model={model} />\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA8BO,MAAM,wBAAwB,CAAC;AAAA,EACpC,WAAA;AAAA,EACA;AACF,CAAA,KAAkC;AAChC,EAAA,YAAA,EAAa;AAEb,EAAA,MAAM,QAAQ,iBAAA,CAAkB,WAAA,IAAe,MAAA,EAAW,QAAA,IAAY,EAAE,CAAA;AACxE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uCAEK,QAAA,EAAA,CAAC,KAAA,IAAU,MAAM,KAAA,CAAM,MAAA,KAAW,KAAK,KAAA,CAAM,KAAA,CAAM,MAAA,KAAW,CAAA,uBAC5D,KAAA,EAAA,EAAI,aAAA,EAAY,qBACd,QAAA,EAAA,CAAA,CAAE,0CAA0C,GAC/C,CAAA,mBAEA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,2BAAA;AAAA,MACZ,SAAA,EAAU,uCAAA;AAAA,MAEV,QAAA,kBAAA,GAAA,CAAC,kBAAe,KAAA,EAAc;AAAA;AAAA,GAChC,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PipelineVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualization.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PipelineRunKind, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { getGraphDataModel } from '../../utils/pipeline-topology-utils';\nimport { PipelineLayout } from './PipelineLayout';\n\nimport './PipelineVisualization.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineVisualizationProps = {\n pipelineRun: PipelineRunKind | null;\n taskRuns: TaskRunKind[];\n};\n\nexport const PipelineVisualization = ({\n pipelineRun,\n taskRuns,\n}: PipelineVisualizationProps) => {\n useDarkTheme();\n\n const model = getGraphDataModel(pipelineRun ?? undefined, taskRuns ?? []);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <>\n {!model || (model.nodes.length === 0 && model.edges.length === 0) ? (\n <div data-testid=\"pipeline-no-tasks\">\n {t('pipelineVisualization.noTasksDescription')}\n </div>\n ) : (\n <div\n data-testid=\"pipelineRun-visualization\"\n className=\"bs-tkn-pipeline-visualization__layout\"\n >\n <PipelineLayout model={model} />\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,wBAAwB,CAAC;AAAA,EACpC,WAAA;AAAA,EACA;AACF,CAAA,KAAkC;AAChC,EAAA,YAAA,EAAa;AAEb,EAAA,MAAM,QAAQ,iBAAA,CAAkB,WAAA,IAAe,MAAA,EAAW,QAAA,IAAY,EAAE,CAAA;AACxE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uCAEK,QAAA,EAAA,CAAC,KAAA,IAAU,MAAM,KAAA,CAAM,MAAA,KAAW,KAAK,KAAA,CAAM,KAAA,CAAM,MAAA,KAAW,CAAA,uBAC5D,KAAA,EAAA,EAAI,aAAA,EAAY,qBACd,QAAA,EAAA,CAAA,CAAE,0CAA0C,GAC/C,CAAA,mBAEA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,2BAAA;AAAA,MACZ,SAAA,EAAU,uCAAA;AAAA,MAEV,QAAA,kBAAA,GAAA,CAAC,kBAAe,KAAA,EAAc;AAAA;AAAA,GAChC,EAEJ,CAAA;AAEJ;;;;"}
@@ -3,7 +3,8 @@ import classNames from 'classnames';
3
3
  import { Status } from '@janus-idp/shared-react';
4
4
  import './PipelineVisualizationStepList.css.esm.js';
5
5
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
- import { tektonTranslationRef } from '../../translation.esm.js';
6
+ import '../../translations/index.esm.js';
7
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
7
8
 
8
9
  const TooltipColoredStatusIcon = ({
9
10
  status
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineVisualizationStepList.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualizationStepList.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RunStatus } from '@patternfly/react-topology';\nimport classNames from 'classnames';\n\nimport { Status } from '@janus-idp/shared-react';\n\nimport { StepStatus } from '../../types/taskRun';\n\nimport './PipelineVisualizationStepList.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\nexport type PipelineVisualizationStepListProps = {\n isSpecOverview: boolean;\n taskName: string;\n steps: StepStatus[];\n isFinallyTask?: boolean;\n hideHeader?: boolean;\n};\n\ntype TooltipColoredStatusIconProps = {\n status: RunStatus;\n};\n\nconst TooltipColoredStatusIcon = ({\n status,\n}: TooltipColoredStatusIconProps) => {\n const icon = <Status status={status} iconOnly />;\n return icon;\n};\n\nexport const PipelineVisualizationStepList = ({\n isSpecOverview,\n taskName,\n steps,\n isFinallyTask,\n hideHeader,\n}: PipelineVisualizationStepListProps) => {\n const { t } = useTranslationRef(tektonTranslationRef);\n return (\n <div className=\"bs-tkn-pipeline-visualization-step-list\">\n {!hideHeader && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__task-name\">\n {taskName}\n </div>\n )}\n {isFinallyTask && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__task-type\">\n {t('pipelineVisualization.stepList.finallyTaskTitle')}\n </div>\n )}\n {steps?.map(({ duration, name, status }) => {\n return (\n <div\n className={classNames(\n 'bs-tkn-pipeline-visualization-step-list__step',\n {\n 'bs-tkn-pipeline-visualization-step-list__step--task-run':\n !isSpecOverview,\n },\n )}\n key={name}\n >\n {!isSpecOverview ? (\n <div className=\"bs-tkn-pipeline-visualization-step-list__icon\">\n <TooltipColoredStatusIcon status={status} />\n </div>\n ) : (\n <span className=\"bs-tkn-pipeline-visualization-step-list__bullet\">\n &bull;\n </span>\n )}\n <div className=\"bs-tkn-pipeline-visualization-step-list__name\">\n {name}\n </div>\n {!isSpecOverview && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__duration\">\n {duration}\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsCA,MAAM,2BAA2B,CAAC;AAAA,EAChC;AACF,CAAA,KAAqC;AACnC,EAAA,MAAM,I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C,cAAA,oBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,qDACZ,QAAA,EAAA,QAAA,EACH;AAAA;AAAA,SAAA;AAAA,QAjBG;AAAA,OAmBP;AAAA,IAEJ,CAAC;AAAA,GAAA,EACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PipelineVisualizationStepList.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualizationStepList.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { RunStatus } from '@patternfly/react-topology';\nimport classNames from 'classnames';\n\nimport { Status } from '@janus-idp/shared-react';\n\nimport { StepStatus } from '../../types/taskRun';\n\nimport './PipelineVisualizationStepList.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nexport type PipelineVisualizationStepListProps = {\n isSpecOverview: boolean;\n taskName: string;\n steps: StepStatus[];\n isFinallyTask?: boolean;\n hideHeader?: boolean;\n};\n\ntype TooltipColoredStatusIconProps = {\n status: RunStatus;\n};\n\nconst TooltipColoredStatusIcon = ({\n status,\n}: TooltipColoredStatusIconProps) => {\n const icon = <Status status={status} iconOnly />;\n return icon;\n};\n\nexport const PipelineVisualizationStepList = ({\n isSpecOverview,\n taskName,\n steps,\n isFinallyTask,\n hideHeader,\n}: PipelineVisualizationStepListProps) => {\n const { t } = useTranslationRef(tektonTranslationRef);\n return (\n <div className=\"bs-tkn-pipeline-visualization-step-list\">\n {!hideHeader && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__task-name\">\n {taskName}\n </div>\n )}\n {isFinallyTask && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__task-type\">\n {t('pipelineVisualization.stepList.finallyTaskTitle')}\n </div>\n )}\n {steps?.map(({ duration, name, status }) => {\n return (\n <div\n className={classNames(\n 'bs-tkn-pipeline-visualization-step-list__step',\n {\n 'bs-tkn-pipeline-visualization-step-list__step--task-run':\n !isSpecOverview,\n },\n )}\n key={name}\n >\n {!isSpecOverview ? (\n <div className=\"bs-tkn-pipeline-visualization-step-list__icon\">\n <TooltipColoredStatusIcon status={status} />\n </div>\n ) : (\n <span className=\"bs-tkn-pipeline-visualization-step-list__bullet\">\n &bull;\n </span>\n )}\n <div className=\"bs-tkn-pipeline-visualization-step-list__name\">\n {name}\n </div>\n {!isSpecOverview && (\n <div className=\"bs-tkn-pipeline-visualization-step-list__duration\">\n {duration}\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAsCA,MAAM,2BAA2B,CAAC;AAAA,EAChC;AACF,CAAA,KAAqC;AACnC,EAAA,MAAM,IAAA,mBAAO,GAAA,CAAC,MAAA,EAAA,EAAO,MAAA,EAAgB,UAAQ,IAAA,EAAC,CAAA;AAC9C,EAAA,OAAO,IAAA;AACT,CAAA;AAEO,MAAM,gCAAgC,CAAC;AAAA,EAC5C,cAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAA0C;AACxC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yCAAA,EACZ,QAAA,EAAA;AAAA,IAAA,CAAC,UAAA,oBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sDACZ,QAAA,EAAA,QAAA,EACH,CAAA;AAAA,IAED,iCACC,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,oDAAA,EACZ,QAAA,EAAA,CAAA,CAAE,iDAAiD,CAAA,EACtD,CAAA;AAAA,IAED,OAAO,GAAA,CAAI,CAAC,EAAE,QAAA,EAAU,IAAA,EAAM,QAAO,KAAM;AAC1C,MAAA,uBACE,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,UAAA;AAAA,YACT,+CAAA;AAAA,YACA;AAAA,cACE,2DACE,CAAC;AAAA;AACL,WACF;AAAA,UAGC,QAAA,EAAA;AAAA,YAAA,CAAC,cAAA,mBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iDACb,QAAA,kBAAA,GAAA,CAAC,wBAAA,EAAA,EAAyB,MAAA,EAAgB,CAAA,EAC5C,CAAA,mBAEA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,mDAAkD,QAAA,EAAA,QAAA,EAElE,CAAA;AAAA,4BAEF,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,+CAAA,EACZ,QAAA,EAAA,IAAA,EACH,CAAA;AAAA,YACC,CAAC,cAAA,oBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,qDACZ,QAAA,EAAA,QAAA,EACH;AAAA;AAAA,SAAA;AAAA,QAjBG;AAAA,OAmBP;AAAA,IAEJ,CAAC;AAAA,GAAA,EACH,CAAA;AAEJ;;;;"}
@@ -7,7 +7,8 @@ import { getPipelineRun } from '../../utils/pipelineRun-utils.esm.js';
7
7
  import { PipelineVisualization } from './PipelineVisualization.esm.js';
8
8
  import './PipelineVisualization.css.esm.js';
9
9
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
10
- import { tektonTranslationRef } from '../../translation.esm.js';
10
+ import '../../translations/index.esm.js';
11
+ import { tektonTranslationRef } from '../../translations/ref.esm.js';
11
12
 
12
13
  const PipelineVisualizationView = ({
13
14
  pipelineRun
@@ -1 +1 @@
1
- {"version":3,"file":"PipelineVisualizationView.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualizationView.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext, useMemo } from 'react';\n\nimport { EmptyState, Progress } from '@backstage/core-components';\n\nimport { isEmpty } from 'lodash';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { getPipelineRun } from '../../utils/pipelineRun-utils';\nimport { PipelineVisualization } from './PipelineVisualization';\n\nimport './PipelineVisualization.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translation';\n\ntype PipelineVisualizationViewProps = {\n pipelineRun: string;\n};\n\nexport const PipelineVisualizationView = ({\n pipelineRun,\n}: PipelineVisualizationViewProps) => {\n const { loaded, responseError, watchResourcesData } = useContext(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const pipelineRunResource = useMemo(\n () =>\n getPipelineRun(watchResourcesData?.pipelineruns?.data ?? [], pipelineRun),\n [watchResourcesData, pipelineRun],\n );\n\n if (!loaded)\n return (\n <div data-testid=\"tekton-progress\">\n <Progress />\n </div>\n );\n\n if (loaded && (responseError || isEmpty(pipelineRunResource))) {\n return (\n <EmptyState\n missing=\"data\"\n description={t('pipelineVisualization.emptyState.description')}\n title=\"\"\n />\n );\n }\n\n return (\n <PipelineVisualization\n pipelineRun={pipelineRunResource}\n taskRuns={watchResourcesData?.taskruns?.data ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAiCO,MAAM,4BAA4B,CAAC;AAAA,EACxC;AACF,CAAA,KAAsC;AACpC,EAAA,MAAM,EAAE,MAAA,EAAQ,aAAA,EAAe,kBAAA,EAAmB,GAAI,UAAA;AAAA,IACpD;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,mBAAA,GAAsB,OAAA;AAAA,IAC1B,MACE,cAAA,CAAe,kBAAA,EAAoB,cAAc,IAAA,IAAQ,IAAI,WAAW,CAAA;AAAA,IAC1E,CAAC,oBAAoB,WAAW;AAAA,GAClC;AAEA,EAAA,IAAI,CAAC,MAAA;AACH,IAAA,2BACG,KAAA,EAAA,EAAI,aAAA,EAAY,iBAAA,EACf,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAGJ,EAAA,IAAI,MAAA,KAAW,aAAA,IAAiB,OAAA,CAAQ,mBAAmB,CAAA,CAAA,EAAI;AAC7D,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,WAAA,EAAa,EAAE,8CAA8C,CAAA;AAAA,QAC7D,KAAA,EAAM;AAAA;AAAA,KACR;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAa,mBAAA;AAAA,MACb,QAAA,EAAU,kBAAA,EAAoB,QAAA,EAAU,IAAA,IAAQ;AAAC;AAAA,GACnD;AAEJ;;;;"}
1
+ {"version":3,"file":"PipelineVisualizationView.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualizationView.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext, useMemo } from 'react';\n\nimport { EmptyState, Progress } from '@backstage/core-components';\n\nimport { isEmpty } from 'lodash';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { getPipelineRun } from '../../utils/pipelineRun-utils';\nimport { PipelineVisualization } from './PipelineVisualization';\n\nimport './PipelineVisualization.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineVisualizationViewProps = {\n pipelineRun: string;\n};\n\nexport const PipelineVisualizationView = ({\n pipelineRun,\n}: PipelineVisualizationViewProps) => {\n const { loaded, responseError, watchResourcesData } = useContext(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n\n const pipelineRunResource = useMemo(\n () =>\n getPipelineRun(watchResourcesData?.pipelineruns?.data ?? [], pipelineRun),\n [watchResourcesData, pipelineRun],\n );\n\n if (!loaded)\n return (\n <div data-testid=\"tekton-progress\">\n <Progress />\n </div>\n );\n\n if (loaded && (responseError || isEmpty(pipelineRunResource))) {\n return (\n <EmptyState\n missing=\"data\"\n description={t('pipelineVisualization.emptyState.description')}\n title=\"\"\n />\n );\n }\n\n return (\n <PipelineVisualization\n pipelineRun={pipelineRunResource}\n taskRuns={watchResourcesData?.taskruns?.data ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,4BAA4B,CAAC;AAAA,EACxC;AACF,CAAA,KAAsC;AACpC,EAAA,MAAM,EAAE,MAAA,EAAQ,aAAA,EAAe,kBAAA,EAAmB,GAAI,UAAA;AAAA,IACpD;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,MAAM,mBAAA,GAAsB,OAAA;AAAA,IAC1B,MACE,cAAA,CAAe,kBAAA,EAAoB,cAAc,IAAA,IAAQ,IAAI,WAAW,CAAA;AAAA,IAC1E,CAAC,oBAAoB,WAAW;AAAA,GAClC;AAEA,EAAA,IAAI,CAAC,MAAA;AACH,IAAA,2BACG,KAAA,EAAA,EAAI,aAAA,EAAY,iBAAA,EACf,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAGJ,EAAA,IAAI,MAAA,KAAW,aAAA,IAAiB,OAAA,CAAQ,mBAAmB,CAAA,CAAA,EAAI;AAC7D,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,WAAA,EAAa,EAAE,8CAA8C,CAAA;AAAA,QAC7D,KAAA,EAAM;AAAA;AAAA,KACR;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAa,mBAAA;AAAA,MACb,QAAA,EAAU,kBAAA,EAAoB,QAAA,EAAU,IAAA,IAAQ;AAAC;AAAA,GACnD;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -95,4 +95,10 @@ declare const tektonTranslationRef: _backstage_core_plugin_api_alpha.Translation
95
95
  readonly "pipelineRunDuration.second_other": "{{count}} seconds";
96
96
  }>;
97
97
 
98
- export { TektonCI, isTektonCIAvailable, tektonPlugin, tektonTranslationRef };
98
+ /**
99
+ * The translation resource for the Tekton plugin
100
+ * @public
101
+ */
102
+ declare const tektonTranslations: _backstage_core_plugin_api_alpha.TranslationResource<"tekton">;
103
+
104
+ export { TektonCI, isTektonCIAvailable, tektonPlugin, tektonTranslationRef, tektonTranslations };
package/dist/index.esm.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { TektonCI, tektonPlugin } from './plugin.esm.js';
2
2
  export { isTektonCIAvailable } from './utils/isTektonCIAvailable.esm.js';
3
- export { tektonTranslationRef } from './translation.esm.js';
3
+ export { tektonTranslations } from './translations/index.esm.js';
4
+ export { tektonTranslationRef } from './translations/ref.esm.js';
4
5
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,10 @@
1
+ import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
2
+ import { tektonTranslationRef } from './ref.esm.js';
3
+
4
+ const tektonTranslations = createTranslationResource({
5
+ ref: tektonTranslationRef,
6
+ translations: {}
7
+ });
8
+
9
+ export { tektonTranslationRef, tektonTranslations };
10
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/translations/index.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationResource } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from './ref';\n\n/**\n * The translation resource for the Tekton plugin\n * @public\n */\nexport const tektonTranslations = createTranslationResource({\n ref: tektonTranslationRef,\n translations: {},\n});\n\nexport { tektonTranslationRef };\n"],"names":[],"mappings":";;;AAuBO,MAAM,qBAAqB,yBAAA,CAA0B;AAAA,EAC1D,GAAA,EAAK,oBAAA;AAAA,EACL,cAAc;AAChB,CAAC;;;;"}
@@ -102,4 +102,4 @@ const tektonTranslationRef = createTranslationRef({
102
102
  });
103
103
 
104
104
  export { tektonTranslationRef };
105
- //# sourceMappingURL=translation.esm.js.map
105
+ //# sourceMappingURL=ref.esm.js.map