@backstage-community/plugin-tekton 3.27.4 → 3.27.6
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.
- package/CHANGELOG.md +12 -0
- package/dist/components/Charts/PipelineBars.esm.js.map +1 -1
- package/dist/components/Icons/CriticalRiskIcon.esm.js.map +1 -1
- package/dist/components/Icons/EqualsIcon.esm.js.map +1 -1
- package/dist/components/Icons/LinkToSbomIcon.esm.js.map +1 -1
- package/dist/components/Icons/OutputIcon.esm.js.map +1 -1
- package/dist/components/Icons/SignedBadge.esm.js.map +1 -1
- package/dist/components/Icons/ViewLogsIcon.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunColumnHeader.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunList.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunListSearchBar.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunOutput.esm.js +1 -1
- package/dist/components/PipelineRunList/PipelineRunOutput.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunRow.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunRowActions.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunSBOMLink.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunTableBody.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunTaskStatus.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunVulnerabilities.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineTableHeader.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PlrStatus.esm.js.map +1 -1
- package/dist/components/PipelineRunList/ResourceBadge.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogDialog.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogDownloader.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogViewer.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PodLogsDownloadLink.esm.js +1 -1
- package/dist/components/PipelineRunLogs/PodLogsDownloadLink.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/TaskStatusStepper.esm.js.map +1 -1
- package/dist/components/PipelineRunOutput/PipelineRunOutputDialog.esm.js.map +1 -1
- package/dist/components/Router.esm.js.map +1 -1
- package/dist/components/Tekton/TektonCIComponent.esm.js.map +1 -1
- package/dist/components/common/ClusterSelector.esm.js.map +1 -1
- package/dist/components/common/ErrorPanel.esm.js.map +1 -1
- package/dist/components/common/PermissionAlert.esm.js.map +1 -1
- package/dist/components/common/StatusSelector.esm.js.map +1 -1
- package/dist/components/common/TableExpandCollapse.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineLayout.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineRunVisualization.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineTaskNode.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineVisualization.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineVisualizationStepList.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineVisualizationView.esm.js.map +1 -1
- package/dist/components/pipeline-topology/TaskGroupEdge.esm.js.map +1 -1
- package/dist/components/pipeline-topology/dag.esm.js.map +1 -1
- package/dist/components/pipeline-topology/pipelineComponentFactory.esm.js.map +1 -1
- package/dist/consts/pipeline-topology-const.esm.js.map +1 -1
- package/dist/consts/tekton-const.esm.js.map +1 -1
- package/dist/hooks/TektonResourcesContext.esm.js.map +1 -1
- package/dist/hooks/useAllWatchResources.esm.js.map +1 -1
- package/dist/hooks/useDarkTheme.esm.js.map +1 -1
- package/dist/hooks/usePipelineRunScanResults.esm.js.map +1 -1
- package/dist/hooks/usePodLogsOfPipelineRun.esm.js +1 -1
- package/dist/hooks/usePodLogsOfPipelineRun.esm.js.map +1 -1
- package/dist/hooks/useResourcesClusters.esm.js.map +1 -1
- package/dist/hooks/useTektonObjectsResponse.esm.js +3 -7
- package/dist/hooks/useTektonObjectsResponse.esm.js.map +1 -1
- package/dist/hooks/useTektonViewPermission.esm.js.map +1 -1
- package/dist/models.esm.js +0 -2
- package/dist/models.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
- package/dist/plugin.esm.js +2 -58
- package/dist/plugin.esm.js.map +1 -1
- package/dist/translation.esm.js.map +1 -1
- package/dist/types/types.esm.js +1 -12
- package/dist/types/types.esm.js.map +1 -1
- package/dist/utils/download-log-file-utils.esm.js.map +1 -1
- package/dist/utils/isTektonCIAvailable.esm.js.map +1 -1
- package/dist/utils/log-downloader-utils.esm.js.map +1 -1
- package/dist/utils/pipeline-step-utils.esm.js.map +1 -1
- package/dist/utils/pipeline-topology-utils.esm.js.map +1 -1
- package/dist/utils/pipelineRun-utils.esm.js.map +1 -1
- package/dist/utils/taskRun-utils.esm.js.map +1 -1
- package/dist/utils/tekton-utils.esm.js.map +1 -1
- package/package.json +2 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineRunVisualization.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 { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { PipelineVisualizationView } from './PipelineVisualizationView';\n\ntype PipelineRunVisualizationProps = {\n pipelineRunName?: string;\n};\n\nexport const PipelineRunVisualization = ({\n pipelineRunName,\n}: PipelineRunVisualizationProps) => {\n useDarkTheme();\n\n return (\n <>\n {pipelineRunName && (\n <PipelineVisualizationView pipelineRun={pipelineRunName} />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,
|
|
1
|
+
{"version":3,"file":"PipelineRunVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineRunVisualization.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 { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { PipelineVisualizationView } from './PipelineVisualizationView';\n\ntype PipelineRunVisualizationProps = {\n pipelineRunName?: string;\n};\n\nexport const PipelineRunVisualization = ({\n pipelineRunName,\n}: PipelineRunVisualizationProps) => {\n useDarkTheme();\n\n return (\n <>\n {pipelineRunName && (\n <PipelineVisualizationView pipelineRun={pipelineRunName} />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,CAAA,KAAqC;AACnC,EAAA,YAAA,EAAa;AAEb,EAAA,uCAEK,QAAA,EAAA,eAAA,oBACC,GAAA,CAAC,yBAAA,EAAA,EAA0B,WAAA,EAAa,iBAAiB,CAAA,EAE7D,CAAA;AAEJ;;;;"}
|
|
@@ -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,CAA6B,KAAA;AAC3B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC/C,EAAM,MAAA,EAAE,oBAAuB,GAAA,UAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAM,MAAA,IAAA,GAAO,QAAQ,OAAQ,EAAA;AAC7B,EAAM,MAAA,UAAA,GAAa,OAA2B,IAAI,CAAA;AAElD,E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EAAA,EAAE,GAAK,EAAA,UAAA,EAAa,QAAS,EAAA,QAAA,EAAA;AAAA;AAAA;AAChC;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEA,yBAAe,IAAA,CAAK,QAAS,CAAA,gBAAgB,CAAC,CAAA;;;;"}
|
|
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,eA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QAAA,kBAAA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,QAAA,EAAS,QAAA;AAAA,cACT,UAAA,EAAY,KAAA;AAAA,cACZ,OAAA,kBACE,GAAA;AAAA,gBAAC,6BAAA;AAAA,gBAAA;AAAA,kBACC,cAAA,EAAgB,CAAC,IAAA,CAAK,MAAA;AAAA,kBACtB,QAAA,EAAU,QAAQ,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;;;;"}
|
|
@@ -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,
|
|
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 +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 •\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,
|
|
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 •\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;;;;"}
|
|
@@ -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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGroupEdge.esm.js","sources":["../../../src/components/pipeline-topology/TaskGroupEdge.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 { Edge, TaskEdge } from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport { GROUPED_PIPELINE_NODE_SEPARATION_HORIZONTAL } from '../../consts/pipeline-topology-const';\n\ninterface TaskEdgeProps {\n element: Edge;\n}\n\nconst TaskGroupEdge = (props: TaskEdgeProps) => (\n <TaskEdge\n nodeSeparation={GROUPED_PIPELINE_NODE_SEPARATION_HORIZONTAL}\n {...props}\n />\n);\n\nexport default observer(TaskGroupEdge);\n"],"names":[],"mappings":";;;;;AAyBA,MAAM,aAAA,GAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"TaskGroupEdge.esm.js","sources":["../../../src/components/pipeline-topology/TaskGroupEdge.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 { Edge, TaskEdge } from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport { GROUPED_PIPELINE_NODE_SEPARATION_HORIZONTAL } from '../../consts/pipeline-topology-const';\n\ninterface TaskEdgeProps {\n element: Edge;\n}\n\nconst TaskGroupEdge = (props: TaskEdgeProps) => (\n <TaskEdge\n nodeSeparation={GROUPED_PIPELINE_NODE_SEPARATION_HORIZONTAL}\n {...props}\n />\n);\n\nexport default observer(TaskGroupEdge);\n"],"names":[],"mappings":";;;;;AAyBA,MAAM,aAAA,GAAgB,CAAC,KAAA,qBACrB,GAAA;AAAA,EAAC,QAAA;AAAA,EAAA;AAAA,IACC,cAAA,EAAgB,2CAAA;AAAA,IACf,GAAG;AAAA;AACN,CAAA;AAGF,sBAAe,SAAS,aAAa,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dag.esm.js","sources":["../../../src/components/pipeline-topology/dag.ts"],"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 */\nexport interface Vertex {\n name: string;\n level: number;\n dependancy: { [key: string]: any };\n dependancyNames: string[];\n hasOutgoing: boolean;\n data: any;\n}\n\ntype Vertices = Map<string, Vertex>;\n\nexport class DAG {\n names: string[];\n\n vertices: Vertices;\n\n constructor() {\n this.names = [];\n this.vertices = new Map();\n }\n\n private visit(\n vertex: Vertex,\n fn: (v: Vertex, path: string[]) => void,\n visited?: any,\n path?: string[],\n ) {\n const { name } = vertex;\n const vertices = vertex.dependancy;\n const names = vertex.dependancyNames;\n const len = names.length;\n\n if (!visited) {\n // eslint-disable-next-line no-param-reassign\n visited = new Map();\n }\n if (!path) {\n // eslint-disable-next-line no-param-reassign\n path = [];\n }\n if (visited.has(name)) {\n return;\n }\n path.push(name);\n visited.set(name, true);\n for (let i = 0; i < len; i++) {\n this.visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n }\n\n private map(name: string, data: any) {\n const vertex = this.addVertex(name) as Vertex;\n vertex.data = data;\n }\n\n addVertex(name: string) {\n if (!name) {\n return null;\n }\n if (this.vertices.has(name)) {\n return this.vertices.get(name);\n }\n\n const vertex: Vertex = {\n name,\n level: 0,\n dependancy: {},\n dependancyNames: [],\n hasOutgoing: false,\n data: {},\n };\n this.vertices.set(name, vertex);\n this.names.push(name);\n return vertex;\n }\n\n addEdge(source: string, target: string): void {\n if (!source || !target || source === target) {\n return;\n }\n const fromNode = this.addVertex(source) as Vertex;\n const toNode = this.addVertex(target) as Vertex;\n\n if (toNode.dependancy[source]) {\n return;\n }\n\n const printPath = (path: string[], tar: string): string => {\n const reversedPath = [...path].reverse();\n return `${reversedPath.join(' --> ')} --> ${tar}`;\n };\n\n const checkCycle = (vertex: Vertex, path: string[]) => {\n if (vertex.name === target) {\n throw new Error(`cycle detected: ${printPath(path, target)}`);\n } else {\n vertex.level = path.length;\n }\n };\n this.visit(fromNode, checkCycle);\n fromNode.hasOutgoing = true;\n toNode.dependancy[source] = fromNode;\n toNode.dependancyNames.push(source);\n }\n\n addEdges(\n name: string,\n data: any,\n before: string | string[],\n after: string | string[],\n ): void {\n this.map(name, data);\n\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n before.forEach(b => this.addEdge(name, b));\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n after.forEach(a => this.addEdge(a, name));\n }\n }\n }\n\n topologicalSort(fn: any): void {\n const visited = new Map();\n const { vertices } = this;\n const { names } = this;\n const len = names.length;\n\n for (let i = 0; i < len; i++) {\n const vertex = vertices.get(names[i]) as Vertex;\n if (!vertex.hasOutgoing) {\n this.visit(vertex, fn, visited);\n }\n }\n }\n\n printGraph() {\n const orderedNodes: string[] = [];\n this.topologicalSort((v: Vertex, t: string) => {\n v.data.stage = this.names.length - t.length;\n orderedNodes.push(v.name);\n });\n // eslint-disable-next-line no-console\n console.log(orderedNodes.join(' --> '));\n return orderedNodes.join(' --> ');\n }\n}\n"],"names":[],"mappings":"AA0BO,MAAM,
|
|
1
|
+
{"version":3,"file":"dag.esm.js","sources":["../../../src/components/pipeline-topology/dag.ts"],"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 */\nexport interface Vertex {\n name: string;\n level: number;\n dependancy: { [key: string]: any };\n dependancyNames: string[];\n hasOutgoing: boolean;\n data: any;\n}\n\ntype Vertices = Map<string, Vertex>;\n\nexport class DAG {\n names: string[];\n\n vertices: Vertices;\n\n constructor() {\n this.names = [];\n this.vertices = new Map();\n }\n\n private visit(\n vertex: Vertex,\n fn: (v: Vertex, path: string[]) => void,\n visited?: any,\n path?: string[],\n ) {\n const { name } = vertex;\n const vertices = vertex.dependancy;\n const names = vertex.dependancyNames;\n const len = names.length;\n\n if (!visited) {\n // eslint-disable-next-line no-param-reassign\n visited = new Map();\n }\n if (!path) {\n // eslint-disable-next-line no-param-reassign\n path = [];\n }\n if (visited.has(name)) {\n return;\n }\n path.push(name);\n visited.set(name, true);\n for (let i = 0; i < len; i++) {\n this.visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n }\n\n private map(name: string, data: any) {\n const vertex = this.addVertex(name) as Vertex;\n vertex.data = data;\n }\n\n addVertex(name: string) {\n if (!name) {\n return null;\n }\n if (this.vertices.has(name)) {\n return this.vertices.get(name);\n }\n\n const vertex: Vertex = {\n name,\n level: 0,\n dependancy: {},\n dependancyNames: [],\n hasOutgoing: false,\n data: {},\n };\n this.vertices.set(name, vertex);\n this.names.push(name);\n return vertex;\n }\n\n addEdge(source: string, target: string): void {\n if (!source || !target || source === target) {\n return;\n }\n const fromNode = this.addVertex(source) as Vertex;\n const toNode = this.addVertex(target) as Vertex;\n\n if (toNode.dependancy[source]) {\n return;\n }\n\n const printPath = (path: string[], tar: string): string => {\n const reversedPath = [...path].reverse();\n return `${reversedPath.join(' --> ')} --> ${tar}`;\n };\n\n const checkCycle = (vertex: Vertex, path: string[]) => {\n if (vertex.name === target) {\n throw new Error(`cycle detected: ${printPath(path, target)}`);\n } else {\n vertex.level = path.length;\n }\n };\n this.visit(fromNode, checkCycle);\n fromNode.hasOutgoing = true;\n toNode.dependancy[source] = fromNode;\n toNode.dependancyNames.push(source);\n }\n\n addEdges(\n name: string,\n data: any,\n before: string | string[],\n after: string | string[],\n ): void {\n this.map(name, data);\n\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n before.forEach(b => this.addEdge(name, b));\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n after.forEach(a => this.addEdge(a, name));\n }\n }\n }\n\n topologicalSort(fn: any): void {\n const visited = new Map();\n const { vertices } = this;\n const { names } = this;\n const len = names.length;\n\n for (let i = 0; i < len; i++) {\n const vertex = vertices.get(names[i]) as Vertex;\n if (!vertex.hasOutgoing) {\n this.visit(vertex, fn, visited);\n }\n }\n }\n\n printGraph() {\n const orderedNodes: string[] = [];\n this.topologicalSort((v: Vertex, t: string) => {\n v.data.stage = this.names.length - t.length;\n orderedNodes.push(v.name);\n });\n // eslint-disable-next-line no-console\n console.log(orderedNodes.join(' --> '));\n return orderedNodes.join(' --> ');\n }\n}\n"],"names":[],"mappings":"AA0BO,MAAM,GAAA,CAAI;AAAA,EACf,KAAA;AAAA,EAEA,QAAA;AAAA,EAEA,WAAA,GAAc;AACZ,IAAA,IAAA,CAAK,QAAQ,EAAC;AACd,IAAA,IAAA,CAAK,QAAA,uBAAe,GAAA,EAAI;AAAA,EAC1B;AAAA,EAEQ,KAAA,CACN,MAAA,EACA,EAAA,EACA,OAAA,EACA,IAAA,EACA;AACA,IAAA,MAAM,EAAE,MAAK,GAAI,MAAA;AACjB,IAAA,MAAM,WAAW,MAAA,CAAO,UAAA;AACxB,IAAA,MAAM,QAAQ,MAAA,CAAO,eAAA;AACrB,IAAA,MAAM,MAAM,KAAA,CAAM,MAAA;AAElB,IAAA,IAAI,CAAC,OAAA,EAAS;AAEZ,MAAA,OAAA,uBAAc,GAAA,EAAI;AAAA,IACpB;AACA,IAAA,IAAI,CAAC,IAAA,E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AAChC,IAAA,IAAA,CAAK,eAAA,CAAgB,CAAC,CAAA,EAAW,CAAA,KAAc;AAC7C,MAAA,CAAA,CAAE,IAAA,CAAK,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,SAAS,CAAA,CAAE,MAAA;AACrC,MAAA,YAAA,CAAa,IAAA,CAAK,EAAE,IAAI,CAAA;AAAA,IAC1B,CAAC,CAAA;AAED,IAAA,OAAA,CAAQ,GAAA,CAAI,YAAA,CAAa,IAAA,CAAK,OAAO,CAAC,CAAA;AACtC,IAAA,OAAO,YAAA,CAAa,KAAK,OAAO,CAAA;AAAA,EAClC;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineComponentFactory.esm.js","sources":["../../../src/components/pipeline-topology/pipelineComponentFactory.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 { ComponentType } from 'react';\n\nimport {\n ComponentFactory,\n DagreLayout,\n DefaultTaskGroup,\n Graph,\n GraphComponent,\n GraphElement,\n LayoutFactory,\n ModelKind,\n PipelineDagreLayout,\n SpacerNode,\n TaskEdge,\n withPanZoom,\n} from '@patternfly/react-topology';\n\nimport { NodeType, PipelineLayout } from '../../consts/pipeline-topology-const';\nimport { getLayoutData } from '../../utils/pipeline-topology-utils';\nimport PipelineTaskNode from './PipelineTaskNode';\nimport TaskGroupEdge from './TaskGroupEdge';\n\nconst GROUPED_EDGE_TYPE = 'GROUPED_EDGE';\n\nexport const layoutFactory: LayoutFactory = (type: string, graph: Graph) => {\n switch (type) {\n case PipelineLayout.DAGRE_BUILDER:\n case PipelineLayout.DAGRE_BUILDER_SPACED:\n return new DagreLayout(graph, {\n // Hack to get around undesirable defaults\n linkDistance: 0,\n nodeDistance: 0,\n groupDistance: 0,\n collideDistance: 0,\n simulationSpeed: 0,\n chargeStrength: 0,\n allowDrag: false,\n layoutOnDrag: false,\n ...getLayoutData(type),\n });\n case PipelineLayout.DAGRE_VIEWER:\n return new PipelineDagreLayout(graph, { nodesep: 25 });\n default:\n return undefined;\n }\n};\n\nconst pipelineComponentFactory: ComponentFactory = (\n kind: ModelKind,\n type: string,\n): ComponentType<{ element: GraphElement }> | undefined => {\n if (kind === ModelKind.graph) {\n return withPanZoom()(GraphComponent) as ComponentType<{\n element: GraphElement;\n }>;\n }\n if (kind === ModelKind.edge) {\n return TaskEdge as ComponentType<{ element: GraphElement }>;\n }\n if (kind === ModelKind.node) {\n switch (type) {\n case NodeType.TASK_NODE:\n case NodeType.FINALLY_NODE:\n return PipelineTaskNode as ComponentType<any>;\n case 'task-group':\n case NodeType.FINALLY_GROUP:\n return DefaultTaskGroup as ComponentType<{\n element: GraphElement;\n }>;\n case NodeType.SPACER_NODE:\n return SpacerNode as ComponentType<{ element: GraphElement }>;\n case 'finally-spacer-edge':\n case NodeType.EDGE:\n return TaskEdge as ComponentType<{ element: GraphElement }>;\n case GROUPED_EDGE_TYPE:\n return TaskGroupEdge as ComponentType<{ element: GraphElement }>;\n default:\n return undefined;\n }\n }\n return undefined;\n};\n\nexport default pipelineComponentFactory;\n"],"names":[],"mappings":";;;;;;AAqCA,MAAM,
|
|
1
|
+
{"version":3,"file":"pipelineComponentFactory.esm.js","sources":["../../../src/components/pipeline-topology/pipelineComponentFactory.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 { ComponentType } from 'react';\n\nimport {\n ComponentFactory,\n DagreLayout,\n DefaultTaskGroup,\n Graph,\n GraphComponent,\n GraphElement,\n LayoutFactory,\n ModelKind,\n PipelineDagreLayout,\n SpacerNode,\n TaskEdge,\n withPanZoom,\n} from '@patternfly/react-topology';\n\nimport { NodeType, PipelineLayout } from '../../consts/pipeline-topology-const';\nimport { getLayoutData } from '../../utils/pipeline-topology-utils';\nimport PipelineTaskNode from './PipelineTaskNode';\nimport TaskGroupEdge from './TaskGroupEdge';\n\nconst GROUPED_EDGE_TYPE = 'GROUPED_EDGE';\n\nexport const layoutFactory: LayoutFactory = (type: string, graph: Graph) => {\n switch (type) {\n case PipelineLayout.DAGRE_BUILDER:\n case PipelineLayout.DAGRE_BUILDER_SPACED:\n return new DagreLayout(graph, {\n // Hack to get around undesirable defaults\n linkDistance: 0,\n nodeDistance: 0,\n groupDistance: 0,\n collideDistance: 0,\n simulationSpeed: 0,\n chargeStrength: 0,\n allowDrag: false,\n layoutOnDrag: false,\n ...getLayoutData(type),\n });\n case PipelineLayout.DAGRE_VIEWER:\n return new PipelineDagreLayout(graph, { nodesep: 25 });\n default:\n return undefined;\n }\n};\n\nconst pipelineComponentFactory: ComponentFactory = (\n kind: ModelKind,\n type: string,\n): ComponentType<{ element: GraphElement }> | undefined => {\n if (kind === ModelKind.graph) {\n return withPanZoom()(GraphComponent) as ComponentType<{\n element: GraphElement;\n }>;\n }\n if (kind === ModelKind.edge) {\n return TaskEdge as ComponentType<{ element: GraphElement }>;\n }\n if (kind === ModelKind.node) {\n switch (type) {\n case NodeType.TASK_NODE:\n case NodeType.FINALLY_NODE:\n return PipelineTaskNode as ComponentType<any>;\n case 'task-group':\n case NodeType.FINALLY_GROUP:\n return DefaultTaskGroup as ComponentType<{\n element: GraphElement;\n }>;\n case NodeType.SPACER_NODE:\n return SpacerNode as ComponentType<{ element: GraphElement }>;\n case 'finally-spacer-edge':\n case NodeType.EDGE:\n return TaskEdge as ComponentType<{ element: GraphElement }>;\n case GROUPED_EDGE_TYPE:\n return TaskGroupEdge as ComponentType<{ element: GraphElement }>;\n default:\n return undefined;\n }\n }\n return undefined;\n};\n\nexport default pipelineComponentFactory;\n"],"names":[],"mappings":";;;;;;AAqCA,MAAM,iBAAA,GAAoB,cAAA;AAEnB,MAAM,aAAA,GAA+B,CAAC,IAAA,EAAc,KAAA,KAAiB;AAC1E,EAAA,QAAQ,IAAA;AAAM,IACZ,KAAK,cAAA,CAAe,aAAA;AAAA,IACpB,KAAK,cAAA,CAAe,oBAAA;AAClB,MAAA,OAAO,IAAI,YAAY,KAAA,EAAO;AAAA;AAAA,QAE5B,YAAA,EAAc,CAAA;AAAA,QACd,YAAA,EAAc,CAAA;AAAA,QACd,aAAA,EAAe,CAAA;AAAA,QACf,eAAA,EAAiB,CAAA;AAAA,QACjB,eAAA,EAAiB,CAAA;AAAA,QACjB,cAAA,EAAgB,CAAA;AAAA,QAChB,SAAA,EAAW,KAAA;AAAA,QACX,YAAA,EAAc,KAAA;AAAA,QACd,GAAG,cAAc,IAAI;AAAA,OACtB,CAAA;AAAA,IACH,KAAK,cAAA,CAAe,YAAA;AAClB,MAAA,OAAO,IAAI,mBAAA,CAAoB,KAAA,EAAO,EAAE,OAAA,EAAS,IAAI,CAAA;AAAA,IACvD;AACE,MAAA,OAAO,MAAA;AAAA;AAEb;AAEA,MAAM,wBAAA,GAA6C,CACjD,IAAA,EACA,IAAA,KACyD;AACzD,EAAA,IAAI,IAAA,KAAS,UAAU,KAAA,EAAO;AAC5B,IAAA,OAAO,WAAA,GAAc,cAAc,CAAA;AAAA,EAGrC;AACA,EAAA,IAAI,IAAA,KAAS,UAAU,IAAA,EAAM;AAC3B,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,IAAI,IAAA,KAAS,UAAU,IAAA,EAAM;AAC3B,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,QAAA,CAAS,SAAA;AAAA,MACd,KAAK,QAAA,CAAS,YAAA;AACZ,QAAA,OAAO,gBAAA;AAAA,MACT,KAAK,YAAA;AAAA,MACL,KAAK,QAAA,CAAS,aAAA;AACZ,QAAA,OAAO,gBAAA;AAAA,MAGT,KAAK,QAAA,CAAS,WAAA;AACZ,QAAA,OAAO,UAAA;AAAA,MACT,KAAK,qBAAA;AAAA,MACL,KAAK,QAAA,CAAS,IAAA;AACZ,QAAA,OAAO,QAAA;AAAA,MACT,KAAK,iBAAA;AACH,QAAA,OAAO,aAAA;AAAA,MACT;AACE,QAAA,OAAO,MAAA;AAAA;AACX,EACF;AACA,EAAA,OAAO,MAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-topology-const.esm.js","sources":["../../src/consts/pipeline-topology-const.ts"],"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 * as dagre from 'dagre';\n\nexport const NODE_SEPARATION_HORIZONTAL = 25;\nexport const NODE_SEPARATION_VERTICAL = 20;\nexport const DROP_SHADOW_SPACING = 5;\nexport const BUILDER_NODE_ADD_RADIUS = 9;\nexport const BUILDER_NODE_DECORATOR_RADIUS = 9;\nexport const BUILDER_NODE_ADD_PADDING = 4;\n\nexport const NODE_WIDTH = 120;\nexport const NODE_HEIGHT = 30;\nexport const FINALLY_NODE_PADDING = 30;\nexport const FINALLY_NODE_VERTICAL_SPACING = 20;\n\nexport const FINALLY_ADD_LINK_TEXT_HEIGHT = 10;\nexport const FINALLY_ADD_LINK_SIZE = 15;\nexport const WHEN_EXPRESSSION_DIAMOND_SIZE = 10;\nexport const WHEN_EXPRESSION_SPACING = 25;\n\nexport const DEFAULT_NODE_HEIGHT = 32;\nexport const NODE_PADDING = 12;\nexport const DEFAULT_NODE_ICON_WIDTH = 30;\nexport const DEFAULT_BADGE_WIDTH = 40;\nexport const DEFAULT_FINALLLY_GROUP_PADDING = 35;\nexport const TOOLBAR_HEIGHT = 40;\nexport const GRAPH_MIN_WIDTH = 300;\nexport const GRAPH_MAX_HEIGHT_PERCENT = 45;\n\nexport enum NodeType {\n TASK_NODE = 'task',\n SPACER_NODE = 'spacer',\n LOADING_NODE = 'loading',\n TASK_LIST_NODE = 'task-list',\n BUILDER_NODE = 'builder',\n INVALID_TASK_LIST_NODE = 'invalid-task-list',\n FINALLY_NODE = 'finally-node',\n BUILDER_FINALLY_NODE = 'builder-finally-node',\n FINALLY_GROUP = 'finally-group',\n EDGE = 'edge',\n}\nexport enum DrawDesign {\n INTEGRAL_SHAPE = 'integral-shape',\n STRAIGHT = 'line',\n}\nexport enum PipelineLayout {\n DAGRE_BUILDER = 'dagre-builder',\n DAGRE_BUILDER_SPACED = 'dagre-builder-spaced',\n DAGRE_VIEWER = 'dagre-viewer',\n DAGRE_VIEWER_SPACED = 'dagre-viewer-spaced',\n}\n\nexport enum AddNodeDirection {\n /**\n * Rules today:\n * - the `relatedTask` is pointing at ONLY us\n * - we inherit all that `relatedTask` is pointing at\n */\n BEFORE = 'in-run-after',\n\n /**\n * Rules today:\n * - the `relatedTask` must be our ONLY runAfter\n * - we are added to all that is pointing at `relatedTask`\n */\n AFTER = 'has-run-after',\n\n /**\n * Rules today:\n * - we inherit all that `relatedTask` is pointing at\n * - we are added to all that is pointing at `relatedTask`\n */\n PARALLEL = 'shared-parallel',\n}\n\nconst DAGRE_SHARED_PROPS: dagre.GraphLabel = {\n nodesep: NODE_SEPARATION_VERTICAL,\n ranksep: NODE_SEPARATION_HORIZONTAL,\n edgesep: 50,\n ranker: 'longest-path',\n rankdir: 'LR',\n marginx: 20,\n marginy: 20,\n};\nexport const DAGRE_VIEWER_PROPS: dagre.GraphLabel = {\n ...DAGRE_SHARED_PROPS,\n};\nexport const DAGRE_VIEWER_SPACED_PROPS: dagre.GraphLabel = {\n ...DAGRE_VIEWER_PROPS,\n ranksep: NODE_SEPARATION_HORIZONTAL + WHEN_EXPRESSION_SPACING,\n};\nexport const DAGRE_BUILDER_PROPS: dagre.GraphLabel = {\n ...DAGRE_SHARED_PROPS,\n ranksep: NODE_SEPARATION_HORIZONTAL + BUILDER_NODE_ADD_RADIUS * 2,\n nodesep: NODE_SEPARATION_VERTICAL + BUILDER_NODE_ADD_RADIUS,\n marginx: DAGRE_SHARED_PROPS.marginx ?? 0 + BUILDER_NODE_ADD_RADIUS * 2,\n marginy: DAGRE_SHARED_PROPS.marginy ?? 0 + BUILDER_NODE_ADD_RADIUS * 2,\n};\n\nexport const DAGRE_BUILDER_SPACED_PROPS: dagre.GraphLabel = {\n ...DAGRE_BUILDER_PROPS,\n ranksep:\n NODE_SEPARATION_HORIZONTAL +\n WHEN_EXPRESSION_SPACING +\n BUILDER_NODE_ADD_RADIUS * 2,\n};\n\nexport const GROUPED_PIPELINE_NODE_SEPARATION_HORIZONTAL = 200;\n\nexport const REGEX_EXTRACT_DEPS =\n /(?:\\$\\(tasks\\.)([a-z0-9_-]+)(?:.results)(?:[.^\\w]+\\))/g;\n"],"names":["NodeType","PipelineLayout"],"mappings":"AAiBO,MAAM,
|
|
1
|
+
{"version":3,"file":"pipeline-topology-const.esm.js","sources":["../../src/consts/pipeline-topology-const.ts"],"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 * as dagre from 'dagre';\n\nexport const NODE_SEPARATION_HORIZONTAL = 25;\nexport const NODE_SEPARATION_VERTICAL = 20;\nexport const DROP_SHADOW_SPACING = 5;\nexport const BUILDER_NODE_ADD_RADIUS = 9;\nexport const BUILDER_NODE_DECORATOR_RADIUS = 9;\nexport const BUILDER_NODE_ADD_PADDING = 4;\n\nexport const NODE_WIDTH = 120;\nexport const NODE_HEIGHT = 30;\nexport const FINALLY_NODE_PADDING = 30;\nexport const FINALLY_NODE_VERTICAL_SPACING = 20;\n\nexport const FINALLY_ADD_LINK_TEXT_HEIGHT = 10;\nexport const FINALLY_ADD_LINK_SIZE = 15;\nexport const WHEN_EXPRESSSION_DIAMOND_SIZE = 10;\nexport const WHEN_EXPRESSION_SPACING = 25;\n\nexport const DEFAULT_NODE_HEIGHT = 32;\nexport const NODE_PADDING = 12;\nexport const DEFAULT_NODE_ICON_WIDTH = 30;\nexport const DEFAULT_BADGE_WIDTH = 40;\nexport const DEFAULT_FINALLLY_GROUP_PADDING = 35;\nexport const TOOLBAR_HEIGHT = 40;\nexport const GRAPH_MIN_WIDTH = 300;\nexport const GRAPH_MAX_HEIGHT_PERCENT = 45;\n\nexport enum NodeType {\n TASK_NODE = 'task',\n SPACER_NODE = 'spacer',\n LOADING_NODE = 'loading',\n TASK_LIST_NODE = 'task-list',\n BUILDER_NODE = 'builder',\n INVALID_TASK_LIST_NODE = 'invalid-task-list',\n FINALLY_NODE = 'finally-node',\n BUILDER_FINALLY_NODE = 'builder-finally-node',\n FINALLY_GROUP = 'finally-group',\n EDGE = 'edge',\n}\nexport enum DrawDesign {\n INTEGRAL_SHAPE = 'integral-shape',\n STRAIGHT = 'line',\n}\nexport enum PipelineLayout {\n DAGRE_BUILDER = 'dagre-builder',\n DAGRE_BUILDER_SPACED = 'dagre-builder-spaced',\n DAGRE_VIEWER = 'dagre-viewer',\n DAGRE_VIEWER_SPACED = 'dagre-viewer-spaced',\n}\n\nexport enum AddNodeDirection {\n /**\n * Rules today:\n * - the `relatedTask` is pointing at ONLY us\n * - we inherit all that `relatedTask` is pointing at\n */\n BEFORE = 'in-run-after',\n\n /**\n * Rules today:\n * - the `relatedTask` must be our ONLY runAfter\n * - we are added to all that is pointing at `relatedTask`\n */\n AFTER = 'has-run-after',\n\n /**\n * Rules today:\n * - we inherit all that `relatedTask` is pointing at\n * - we are added to all that is pointing at `relatedTask`\n */\n PARALLEL = 'shared-parallel',\n}\n\nconst DAGRE_SHARED_PROPS: dagre.GraphLabel = {\n nodesep: NODE_SEPARATION_VERTICAL,\n ranksep: NODE_SEPARATION_HORIZONTAL,\n edgesep: 50,\n ranker: 'longest-path',\n rankdir: 'LR',\n marginx: 20,\n marginy: 20,\n};\nexport const DAGRE_VIEWER_PROPS: dagre.GraphLabel = {\n ...DAGRE_SHARED_PROPS,\n};\nexport const DAGRE_VIEWER_SPACED_PROPS: dagre.GraphLabel = {\n ...DAGRE_VIEWER_PROPS,\n ranksep: NODE_SEPARATION_HORIZONTAL + WHEN_EXPRESSION_SPACING,\n};\nexport const DAGRE_BUILDER_PROPS: dagre.GraphLabel = {\n ...DAGRE_SHARED_PROPS,\n ranksep: NODE_SEPARATION_HORIZONTAL + BUILDER_NODE_ADD_RADIUS * 2,\n nodesep: NODE_SEPARATION_VERTICAL + BUILDER_NODE_ADD_RADIUS,\n marginx: DAGRE_SHARED_PROPS.marginx ?? 0 + BUILDER_NODE_ADD_RADIUS * 2,\n marginy: DAGRE_SHARED_PROPS.marginy ?? 0 + BUILDER_NODE_ADD_RADIUS * 2,\n};\n\nexport const DAGRE_BUILDER_SPACED_PROPS: dagre.GraphLabel = {\n ...DAGRE_BUILDER_PROPS,\n ranksep:\n NODE_SEPARATION_HORIZONTAL +\n WHEN_EXPRESSION_SPACING +\n BUILDER_NODE_ADD_RADIUS * 2,\n};\n\nexport const GROUPED_PIPELINE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,GAAe,cAAA;AACf,EAAAA,gBAAA,qBAAA,CAAA,GAAsB,qBAAA;AAJZ,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AA8BZ,MAAM,kBAAA,GAAuC;AAAA,EAC3C,OAAA,EAAS,wBAAA;AAAA,EACT,OAAA,EAAS,0BAAA;AAAA,EACT,OAAA,EAAS,EAAA;AAAA,EACT,MAAA,EAAQ,cAAA;AAAA,EACR,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,EAAA;AAAA,EACT,OAAA,EAAS;AACX,CAAA;AACO,MAAM,kBAAA,GAAuC;AAAA,EAClD,GAAG;AACL;AACO,MAAM,yBAAA,GAA8C;AAAA,EACzD,GAAG,kBAAA;AAAA,EACH,SAAS,0BAAA,GAA6B;AACxC;AACO,MAAM,mBAAA,GAAwC;AAAA,EACnD,GAAG,kBAAA;AAAA,EACH,OAAA,EAAS,6BAA6B,uBAAA,GAA0B,CAAA;AAAA,EAChE,SAAS,wBAAA,GAA2B,uBAAA;AAAA,EACpC,OAAA,EAAS,kBAAA,CAAmB,OAAyC;AAAA,EACrE,OAAA,EAAS,kBAAA,CAAmB;AAC9B;AAEO,MAAM,0BAAA,GAA+C;AAAA,EAC1D,GAAG,mBAAA;AAAA,EACH,OAAA,EACE,0BAAA,GACA,uBAAA,GACA,uBAAA,GAA0B;AAC9B;AAEO,MAAM,2CAAA,GAA8C;AAEpD,MAAM,kBAAA,GACX;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekton-const.esm.js","sources":["../../src/consts/tekton-const.ts"],"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 */\nexport const TEKTON_PIPELINE_TASK = 'tekton.dev/pipelineTask';\nexport const TEKTON_PIPELINE_RUN = 'tekton.dev/pipelineRun';\nexport const TEKTON_PIPELINE_TASKRUN = 'tekton.dev/taskRun';\nexport const TEKTON_SIGNED_ANNOTATION = 'chains.tekton.dev/signed';\n"],"names":[],"mappings":"AAeO,MAAM,
|
|
1
|
+
{"version":3,"file":"tekton-const.esm.js","sources":["../../src/consts/tekton-const.ts"],"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 */\nexport const TEKTON_PIPELINE_TASK = 'tekton.dev/pipelineTask';\nexport const TEKTON_PIPELINE_RUN = 'tekton.dev/pipelineRun';\nexport const TEKTON_PIPELINE_TASKRUN = 'tekton.dev/taskRun';\nexport const TEKTON_SIGNED_ANNOTATION = 'chains.tekton.dev/signed';\n"],"names":[],"mappings":"AAeO,MAAM,oBAAA,GAAuB;AAC7B,MAAM,mBAAA,GAAsB;AAC5B,MAAM,uBAAA,GAA0B;AAChC,MAAM,wBAAA,GAA2B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TektonResourcesContext.esm.js","sources":["../../src/hooks/TektonResourcesContext.ts"],"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 { createContext } from 'react';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TektonResourcesContextData } from '../types/types';\n\nexport const TektonResourcesContext = createContext<TektonResourcesContextData>(\n {\n clusters: [],\n selectedStatus: ComputedStatus.All,\n setSelectedCluster: () => {},\n setSelectedStatus: () => {},\n setIsExpanded: () => {},\n },\n);\n"],"names":[],"mappings":";;;AAqBO,MAAM,
|
|
1
|
+
{"version":3,"file":"TektonResourcesContext.esm.js","sources":["../../src/hooks/TektonResourcesContext.ts"],"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 { createContext } from 'react';\n\nimport { ComputedStatus } from '@janus-idp/shared-react';\n\nimport { TektonResourcesContextData } from '../types/types';\n\nexport const TektonResourcesContext = createContext<TektonResourcesContextData>(\n {\n clusters: [],\n selectedStatus: ComputedStatus.All,\n setSelectedCluster: () => {},\n setSelectedStatus: () => {},\n setIsExpanded: () => {},\n },\n);\n"],"names":[],"mappings":";;;AAqBO,MAAM,sBAAA,GAAyB,aAAA;AAAA,EACpC;AAAA,IACE,UAAU,EAAC;AAAA,IACX,gBAAgB,cAAA,CAAe,GAAA;AAAA,IAC/B,oBAAoB,MAAM;AAAA,IAAC,CAAA;AAAA,IAC3B,mBAAmB,MAAM;AAAA,IAAC,CAAA;AAAA,IAC1B,eAAe,MAAM;AAAA,IAAC;AAAA;AAE1B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAllWatchResources.esm.js","sources":["../../src/hooks/useAllWatchResources.ts"],"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 { useEffect, useMemo, useState } from 'react';\n\nimport { KubernetesObjects } from '@backstage/plugin-kubernetes-react';\n\nimport { useDeepCompareMemoize } from '@janus-idp/shared-react';\n\nimport { TektonResponseData } from '../types/types';\nimport { getTektonResources } from '../utils/tekton-utils';\n\nexport const useAllWatchResources = (\n k8sObjectsResponse: KubernetesObjects,\n cluster: number,\n watchedResource: string[] = [],\n): TektonResponseData => {\n const { kubernetesObjects, loading, error } = k8sObjectsResponse;\n const [resources, setResources] = useState<TektonResponseData>({});\n\n useEffect(() => {\n let isMounted = true;\n if (isMounted && !loading && kubernetesObjects && !error) {\n const tektonResources: TektonResponseData = getTektonResources(\n cluster,\n kubernetesObjects,\n );\n if (tektonResources) {\n setResources(tektonResources);\n }\n }\n return () => {\n isMounted = false;\n };\n }, [loading, kubernetesObjects, error, cluster]);\n\n const watchResourcesData = useMemo(() => {\n return watchedResource.reduce((acc: TektonResponseData, resKind) => {\n if (resources[resKind]) {\n acc[resKind] = resources[resKind];\n }\n return acc;\n }, {});\n }, [watchedResource, resources]);\n\n return useDeepCompareMemoize(watchResourcesData);\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,uBAAuB,CAClC,kBAAA,EACA,
|
|
1
|
+
{"version":3,"file":"useAllWatchResources.esm.js","sources":["../../src/hooks/useAllWatchResources.ts"],"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 { useEffect, useMemo, useState } from 'react';\n\nimport { KubernetesObjects } from '@backstage/plugin-kubernetes-react';\n\nimport { useDeepCompareMemoize } from '@janus-idp/shared-react';\n\nimport { TektonResponseData } from '../types/types';\nimport { getTektonResources } from '../utils/tekton-utils';\n\nexport const useAllWatchResources = (\n k8sObjectsResponse: KubernetesObjects,\n cluster: number,\n watchedResource: string[] = [],\n): TektonResponseData => {\n const { kubernetesObjects, loading, error } = k8sObjectsResponse;\n const [resources, setResources] = useState<TektonResponseData>({});\n\n useEffect(() => {\n let isMounted = true;\n if (isMounted && !loading && kubernetesObjects && !error) {\n const tektonResources: TektonResponseData = getTektonResources(\n cluster,\n kubernetesObjects,\n );\n if (tektonResources) {\n setResources(tektonResources);\n }\n }\n return () => {\n isMounted = false;\n };\n }, [loading, kubernetesObjects, error, cluster]);\n\n const watchResourcesData = useMemo(() => {\n return watchedResource.reduce((acc: TektonResponseData, resKind) => {\n if (resources[resKind]) {\n acc[resKind] = resources[resKind];\n }\n return acc;\n }, {});\n }, [watchedResource, resources]);\n\n return useDeepCompareMemoize(watchResourcesData);\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,uBAAuB,CAClC,kBAAA,EACA,OAAA,EACA,eAAA,GAA4B,EAAC,KACN;AACvB,EAAA,MAAM,EAAE,iBAAA,EAAmB,OAAA,EAAS,KAAA,EAAM,GAAI,kBAAA;AAC9C,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,QAAA,CAA6B,EAAE,CAAA;AAEjE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,SAAA,GAAY,IAAA;AAChB,IAAA,IAAI,SAAA,IAAa,CAAC,OAAA,IAAW,iBAAA,IAAqB,CAAC,KAAA,EAAO;AACxD,MAAA,MAAM,eAAA,GAAsC,kBAAA;AAAA,QAC1C,OAAA;AAAA,QACA;AAAA,OACF;AACA,MAAA,IAAI,eAAA,EAAiB;AACnB,QAAA,YAAA,CAAa,eAAe,CAAA;AAAA,MAC9B;AAAA,IACF;AACA,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,GAAY,KAAA;AAAA,IACd,CAAA;AAAA,EACF,GAAG,CAAC,OAAA,EAAS,iBAAA,EAAmB,KAAA,EAAO,OAAO,CAAC,CAAA;AAE/C,EAAA,MAAM,kBAAA,GAAqB,QAAQ,MAAM;AACvC,IAAA,OAAO,eAAA,CAAgB,MAAA,CAAO,CAAC,GAAA,EAAyB,OAAA,KAAY;AAClE,MAAA,IAAI,SAAA,CAAU,OAAO,CAAA,EAAG;AACtB,QAAA,GAAA,CAAI,OAAO,CAAA,GAAI,SAAA,CAAU,OAAO,CAAA;AAAA,MAClC;AACA,MAAA,OAAO,GAAA;AAAA,IACT,CAAA,EAAG,EAAE,CAAA;AAAA,EACP,CAAA,EAAG,CAAC,eAAA,EAAiB,SAAS,CAAC,CAAA;AAE/B,EAAA,OAAO,sBAAsB,kBAAkB,CAAA;AACjD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkTheme.esm.js","sources":["../../src/hooks/useDarkTheme.ts"],"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 { useEffect } from 'react';\n\nimport { useTheme } from '@material-ui/core/styles';\n\nconst THEME_DARK = 'dark';\nconst THEME_DARK_CLASS = 'pf-v6-theme-dark';\n\nexport const useDarkTheme = () => {\n const {\n palette: { type },\n } = useTheme();\n\n useEffect(() => {\n const htmlTagElement = document.documentElement;\n if (type === THEME_DARK) {\n htmlTagElement.classList.add(THEME_DARK_CLASS);\n } else {\n htmlTagElement.classList.remove(THEME_DARK_CLASS);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [type]);\n};\n"],"names":[],"mappings":";;;AAmBA,MAAM,
|
|
1
|
+
{"version":3,"file":"useDarkTheme.esm.js","sources":["../../src/hooks/useDarkTheme.ts"],"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 { useEffect } from 'react';\n\nimport { useTheme } from '@material-ui/core/styles';\n\nconst THEME_DARK = 'dark';\nconst THEME_DARK_CLASS = 'pf-v6-theme-dark';\n\nexport const useDarkTheme = () => {\n const {\n palette: { type },\n } = useTheme();\n\n useEffect(() => {\n const htmlTagElement = document.documentElement;\n if (type === THEME_DARK) {\n htmlTagElement.classList.add(THEME_DARK_CLASS);\n } else {\n htmlTagElement.classList.remove(THEME_DARK_CLASS);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [type]);\n};\n"],"names":[],"mappings":";;;AAmBA,MAAM,UAAA,GAAa,MAAA;AACnB,MAAM,gBAAA,GAAmB,kBAAA;AAElB,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM;AAAA,IACJ,OAAA,EAAS,EAAE,IAAA;AAAK,MACd,QAAA,EAAS;AAEb,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,iBAAiB,QAAA,CAAS,eAAA;AAChC,IAAA,IAAI,SAAS,UAAA,EAAY;AACvB,MAAA,cAAA,CAAe,SAAA,CAAU,IAAI,gBAAgB,CAAA;AAAA,IAC/C,CAAA,MAAO;AACL,MAAA,cAAA,CAAe,SAAA,CAAU,OAAO,gBAAgB,CAAA;AAAA,IAClD;AAAA,EAEF,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AACX;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePipelineRunScanResults.esm.js","sources":["../../src/hooks/usePipelineRunScanResults.ts"],"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 { useMemo } from 'react';\n\nimport { PipelineRunKind } from '@janus-idp/shared-react';\n\nimport { PipelineRunScanResults } from '../types/types';\n\nconst SCAN_OUTPUT_SUFFIX = 'SCAN_OUTPUT';\n\nexport const getPipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults =>\n (pipelineRun.status?.results || pipelineRun.status?.pipelineResults)?.reduce(\n (acc, result) => {\n if (result.name?.endsWith(SCAN_OUTPUT_SUFFIX)) {\n if (!acc.vulnerabilities) {\n acc.vulnerabilities = { critical: 0, high: 0, medium: 0, low: 0 };\n }\n try {\n const taskVulnerabilities = JSON.parse(result.value);\n if (taskVulnerabilities.vulnerabilities) {\n acc.vulnerabilities.critical +=\n taskVulnerabilities.vulnerabilities.critical || 0;\n acc.vulnerabilities.high +=\n taskVulnerabilities.vulnerabilities.high || 0;\n acc.vulnerabilities.medium +=\n taskVulnerabilities.vulnerabilities.medium || 0;\n acc.vulnerabilities.low +=\n taskVulnerabilities.vulnerabilities.low || 0;\n }\n } catch (e) {\n // ignore\n }\n }\n return acc;\n },\n {} as PipelineRunScanResults,\n ) || {};\n\nexport const usePipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults => {\n return useMemo(() => {\n if (!pipelineRun) {\n return {};\n }\n\n return getPipelineRunScanResults(pipelineRun);\n }, [pipelineRun]);\n};\n"],"names":[],"mappings":";;AAqBA,MAAM,
|
|
1
|
+
{"version":3,"file":"usePipelineRunScanResults.esm.js","sources":["../../src/hooks/usePipelineRunScanResults.ts"],"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 { useMemo } from 'react';\n\nimport { PipelineRunKind } from '@janus-idp/shared-react';\n\nimport { PipelineRunScanResults } from '../types/types';\n\nconst SCAN_OUTPUT_SUFFIX = 'SCAN_OUTPUT';\n\nexport const getPipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults =>\n (pipelineRun.status?.results || pipelineRun.status?.pipelineResults)?.reduce(\n (acc, result) => {\n if (result.name?.endsWith(SCAN_OUTPUT_SUFFIX)) {\n if (!acc.vulnerabilities) {\n acc.vulnerabilities = { critical: 0, high: 0, medium: 0, low: 0 };\n }\n try {\n const taskVulnerabilities = JSON.parse(result.value);\n if (taskVulnerabilities.vulnerabilities) {\n acc.vulnerabilities.critical +=\n taskVulnerabilities.vulnerabilities.critical || 0;\n acc.vulnerabilities.high +=\n taskVulnerabilities.vulnerabilities.high || 0;\n acc.vulnerabilities.medium +=\n taskVulnerabilities.vulnerabilities.medium || 0;\n acc.vulnerabilities.low +=\n taskVulnerabilities.vulnerabilities.low || 0;\n }\n } catch (e) {\n // ignore\n }\n }\n return acc;\n },\n {} as PipelineRunScanResults,\n ) || {};\n\nexport const usePipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults => {\n return useMemo(() => {\n if (!pipelineRun) {\n return {};\n }\n\n return getPipelineRunScanResults(pipelineRun);\n }, [pipelineRun]);\n};\n"],"names":[],"mappings":";;AAqBA,MAAM,kBAAA,GAAqB,aAAA;AAEpB,MAAM,yBAAA,GAA4B,CACvC,WAAA,KAAA,CAEC,WAAA,CAAY,QAAQ,OAAA,IAAW,WAAA,CAAY,QAAQ,eAAA,GAAkB,MAAA;AAAA,EACpE,CAAC,KAAK,MAAA,KAAW;AACf,IAAA,IAAI,MAAA,CAAO,IAAA,EAAM,QAAA,CAAS,kBAAkB,CAAA,EAAG;AAC7C,MAAA,IAAI,CAAC,IAAI,eAAA,EAAiB;AACxB,QAAA,GAAA,CAAI,eAAA,GAAkB,EAAE,QAAA,EAAU,CAAA,EAAG,MAAM,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,GAAA,EAAK,CAAA,EAAE;AAAA,MAClE;AACA,MAAA,IAAI;AACF,QAAA,MAAM,mBAAA,GAAsB,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA;AACnD,QAAA,IAAI,oBAAoB,eAAA,EAAiB;AACvC,UAAA,GAAA,CAAI,eAAA,CAAgB,QAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,QAAA,IAAY,CAAA;AAClD,UAAA,GAAA,CAAI,eAAA,CAAgB,IAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,IAAA,IAAQ,CAAA;AAC9C,UAAA,GAAA,CAAI,eAAA,CAAgB,MAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,MAAA,IAAU,CAAA;AAChD,UAAA,GAAA,CAAI,eAAA,CAAgB,GAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,GAAA,IAAO,CAAA;AAAA,QAC/C;AAAA,MACF,SAAS,CAAA,EAAG;AAAA,MAEZ;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA;AACF,CAAA,IAAK;AAEA,MAAM,yBAAA,GAA4B,CACvC,WAAA,KAC2B;AAC3B,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,OAAO,EAAC;AAAA,IACV;AAEA,IAAA,OAAO,0BAA0B,WAAW,CAAA;AAAA,EAC9C,CAAA,EAAG,CAAC,WAAW,CAAC,CAAA;AAClB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { kubernetesProxyApiRef } from '@backstage/plugin-kubernetes-react';
|
|
3
4
|
import { useApi } from '@backstage/core-plugin-api';
|
|
4
|
-
import { kubernetesProxyApiRef } from '../types/types.esm.js';
|
|
5
5
|
import { TektonResourcesContext } from './TektonResourcesContext.esm.js';
|
|
6
6
|
|
|
7
7
|
const usePodLogsOfPipelineRun = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePodLogsOfPipelineRun.esm.js","sources":["../../src/hooks/usePodLogsOfPipelineRun.ts"],"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';\nimport { useQuery } from '@tanstack/react-query';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { V1Container, V1Pod } from '@kubernetes/client-node';\n\nimport {
|
|
1
|
+
{"version":3,"file":"usePodLogsOfPipelineRun.esm.js","sources":["../../src/hooks/usePodLogsOfPipelineRun.ts"],"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';\nimport { useQuery } from '@tanstack/react-query';\nimport { kubernetesProxyApiRef } from '@backstage/plugin-kubernetes-react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { V1Container, V1Pod } from '@kubernetes/client-node';\n\nimport { TektonResourcesContextData } from '../types/types';\nimport { TektonResourcesContext } from './TektonResourcesContext';\n\nexport interface ContainerScope {\n podName: string;\n podNamespace: string;\n clusterName: string;\n containerName: string;\n}\n\ninterface PodLogsOptions {\n pod: V1Pod;\n intervalMs?: number;\n}\n\nexport const usePodLogsOfPipelineRun = ({\n pod,\n intervalMs = 5000,\n}: PodLogsOptions) => {\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n const { clusters, selectedCluster } = useContext<TektonResourcesContextData>(\n TektonResourcesContext,\n );\n const currCluster =\n (clusters.length > 0 && clusters[selectedCluster || 0]) || '';\n const containersList = pod?.spec?.containers || [];\n\n const podKey = pod?.metadata?.name;\n const stopPolling =\n pod?.status?.phase === 'Succeeded' || pod?.status?.phase === 'Failed';\n\n const { data, error, isLoading, isFetching } = useQuery({\n queryKey: ['podLogs', podKey, currCluster],\n queryFn: async () => {\n const requests = containersList\n .map((container: V1Container) => {\n if (pod?.metadata?.name && pod?.metadata?.namespace && container) {\n return kubernetesProxyApi.getPodLogs({\n podName: pod.metadata.name,\n namespace: pod.metadata.namespace,\n containerName: container.name,\n clusterName: currCluster,\n });\n }\n\n return Promise.resolve({ text: '' });\n })\n .filter(Boolean);\n\n return Promise.all(requests);\n },\n enabled: !!pod?.metadata?.name && containersList.length > 0,\n refetchInterval: stopPolling ? false : intervalMs,\n staleTime: 60000, // Keep the data fresh for 1 minute instead of constantly refetching.\n });\n\n return {\n value: data,\n error,\n loading: isLoading || isFetching,\n };\n};\n"],"names":[],"mappings":";;;;;;AAoCO,MAAM,0BAA0B,CAAC;AAAA,EACtC,GAAA;AAAA,EACA,UAAA,GAAa;AACf,CAAA,KAAsB;AACpB,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AACvD,EAAA,MAAM,EAAE,QAAA,EAAU,eAAA,EAAgB,GAAI,UAAA;AAAA,IACpC;AAAA,GACF;AACA,EAAA,MAAM,cACH,QAAA,CAAS,MAAA,GAAS,KAAK,QAAA,CAAS,eAAA,IAAmB,CAAC,CAAA,IAAM,EAAA;AAC7D,EAAA,MAAM,cAAA,GAAiB,GAAA,EAAK,IAAA,EAAM,UAAA,IAAc,EAAC;AAEjD,EAAA,MAAM,MAAA,GAAS,KAAK,QAAA,EAAU,IAAA;AAC9B,EAAA,MAAM,cACJ,GAAA,EAAK,MAAA,EAAQ,UAAU,WAAA,IAAe,GAAA,EAAK,QAAQ,KAAA,KAAU,QAAA;AAE/D,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,SAAA,EAAW,UAAA,KAAe,QAAA,CAAS;AAAA,IACtD,QAAA,EAAU,CAAC,SAAA,EAAW,MAAA,EAAQ,WAAW,CAAA;AAAA,IACzC,SAAS,YAAY;AACnB,MAAA,MAAM,QAAA,GAAW,cAAA,CACd,GAAA,CAAI,CAAC,SAAA,KAA2B;AAC/B,QAAA,IAAI,KAAK,QAAA,EAAU,IAAA,IAAQ,GAAA,EAAK,QAAA,EAAU,aAAa,SAAA,EAAW;AAChE,UAAA,OAAO,mBAAmB,UAAA,CAAW;AAAA,YACnC,OAAA,EAAS,IAAI,QAAA,CAAS,IAAA;AAAA,YACtB,SAAA,EAAW,IAAI,QAAA,CAAS,SAAA;AAAA,YACxB,eAAe,SAAA,CAAU,IAAA;AAAA,YACzB,WAAA,EAAa;AAAA,WACd,CAAA;AAAA,QACH;AAEA,QAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA,MACrC,CAAC,CAAA,CACA,MAAA,CAAO,OAAO,CAAA;AAEjB,MAAA,OAAO,OAAA,CAAQ,IAAI,QAAQ,CAAA;AAAA,IAC7B,CAAA;AAAA,IACA,SAAS,CAAC,CAAC,KAAK,QAAA,EAAU,IAAA,IAAQ,eAAe,MAAA,GAAS,CAAA;AAAA,IAC1D,eAAA,EAAiB,cAAc,KAAA,GAAQ,UAAA;AAAA,IACvC,SAAA,EAAW;AAAA;AAAA,GACZ,CAAA;AAED,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,IAAA;AAAA,IACP,KAAA;AAAA,IACA,SAAS,SAAA,IAAa;AAAA,GACxB;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResourcesClusters.esm.js","sources":["../../src/hooks/useResourcesClusters.ts"],"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 { useEffect, useState } from 'react';\n\nimport { KubernetesObjects } from '@backstage/plugin-kubernetes-react';\n\nimport { useDeepCompareMemoize } from '@janus-idp/shared-react';\n\nimport { ClusterErrors } from '../types/types';\nimport { getClusters } from '../utils/tekton-utils';\n\nexport const useResourcesClusters = (k8sObjectsResponse: KubernetesObjects) => {\n const { kubernetesObjects, loading, error } = k8sObjectsResponse;\n const [clusters, setClusters] = useState<{\n clusters: string[];\n errors: ClusterErrors[];\n }>({ clusters: [], errors: [] });\n\n useEffect(() => {\n let isMounted = true;\n if (isMounted && !loading && kubernetesObjects && !error) {\n const k8sResourcesClusters = getClusters(kubernetesObjects);\n if (k8sResourcesClusters) {\n setClusters(k8sResourcesClusters);\n }\n }\n return () => {\n isMounted = false;\n };\n }, [loading, kubernetesObjects, error]);\n\n return useDeepCompareMemoize(clusters);\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useResourcesClusters.esm.js","sources":["../../src/hooks/useResourcesClusters.ts"],"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 { useEffect, useState } from 'react';\n\nimport { KubernetesObjects } from '@backstage/plugin-kubernetes-react';\n\nimport { useDeepCompareMemoize } from '@janus-idp/shared-react';\n\nimport { ClusterErrors } from '../types/types';\nimport { getClusters } from '../utils/tekton-utils';\n\nexport const useResourcesClusters = (k8sObjectsResponse: KubernetesObjects) => {\n const { kubernetesObjects, loading, error } = k8sObjectsResponse;\n const [clusters, setClusters] = useState<{\n clusters: string[];\n errors: ClusterErrors[];\n }>({ clusters: [], errors: [] });\n\n useEffect(() => {\n let isMounted = true;\n if (isMounted && !loading && kubernetesObjects && !error) {\n const k8sResourcesClusters = getClusters(kubernetesObjects);\n if (k8sResourcesClusters) {\n setClusters(k8sResourcesClusters);\n }\n }\n return () => {\n isMounted = false;\n };\n }, [loading, kubernetesObjects, error]);\n\n return useDeepCompareMemoize(clusters);\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,oBAAA,GAAuB,CAAC,kBAAA,KAA0C;AAC7E,EAAA,MAAM,EAAE,iBAAA,EAAmB,OAAA,EAAS,KAAA,EAAM,GAAI,kBAAA;AAC9C,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,QAAA,CAG7B,EAAE,QAAA,EAAU,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAG,CAAA;AAE/B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,SAAA,GAAY,IAAA;AAChB,IAAA,IAAI,SAAA,IAAa,CAAC,OAAA,IAAW,iBAAA,IAAqB,CAAC,KAAA,EAAO;AACxD,MAAA,MAAM,oBAAA,GAAuB,YAAY,iBAAiB,CAAA;AAC1D,MAAA,IAAI,oBAAA,EAAsB;AACxB,QAAA,WAAA,CAAY,oBAAoB,CAAA;AAAA,MAClC;AAAA,IACF;AACA,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,GAAY,KAAA;AAAA,IACd,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,OAAA,EAAS,iBAAA,EAAmB,KAAK,CAAC,CAAA;AAEtC,EAAA,OAAO,sBAAsB,QAAQ,CAAA;AACvC;;;;"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
3
|
import { isEqual } from 'lodash';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useDebounceCallback, useDeepCompareMemoize } from '@janus-idp/shared-react';
|
|
5
|
+
import { useKubernetesObjects } from '@backstage/plugin-kubernetes-react';
|
|
6
6
|
import { useAllWatchResources } from './useAllWatchResources.esm.js';
|
|
7
7
|
import { useResourcesClusters } from './useResourcesClusters.esm.js';
|
|
8
8
|
|
|
9
9
|
const useTektonObjectsResponse = (watchedResource) => {
|
|
10
10
|
const { entity } = useEntity();
|
|
11
|
-
const { kubernetesObjects, loading, error } = useKubernetesObjects(
|
|
12
|
-
entity,
|
|
13
|
-
kubernetesApiRef,
|
|
14
|
-
kubernetesAuthProvidersApiRef
|
|
15
|
-
);
|
|
11
|
+
const { kubernetesObjects, loading, error } = useKubernetesObjects(entity);
|
|
16
12
|
const [selectedCluster, setSelectedCluster] = useState(0);
|
|
17
13
|
const [selectedStatus, setSelectedStatus] = useState(
|
|
18
14
|
"All"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTektonObjectsResponse.esm.js","sources":["../../src/hooks/useTektonObjectsResponse.ts"],"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, useRef, useEffect, useCallback } from 'react';\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { isEqual } from 'lodash';\n\nimport {\n ComputedStatus,\n useDebounceCallback,\n useDeepCompareMemoize,\n
|
|
1
|
+
{"version":3,"file":"useTektonObjectsResponse.esm.js","sources":["../../src/hooks/useTektonObjectsResponse.ts"],"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, useRef, useEffect, useCallback } from 'react';\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { isEqual } from 'lodash';\n\nimport {\n ComputedStatus,\n useDebounceCallback,\n useDeepCompareMemoize,\n} from '@janus-idp/shared-react';\n\nimport { useKubernetesObjects } from '@backstage/plugin-kubernetes-react';\nimport { TektonResourcesContextData, TektonResponseData } from '../types/types';\nimport { useAllWatchResources } from './useAllWatchResources';\nimport { useResourcesClusters } from './useResourcesClusters';\n\nexport const useTektonObjectsResponse = (\n watchedResource: string[],\n): TektonResourcesContextData => {\n const { entity } = useEntity();\n const { kubernetesObjects, loading, error } = useKubernetesObjects(entity);\n const [selectedCluster, setSelectedCluster] = useState<number>(0);\n const [selectedStatus, setSelectedStatus] = useState<ComputedStatus>(\n 'All' as ComputedStatus,\n );\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const [loaded, setLoaded] = useState<boolean>(false);\n const [errorState, setErrorState] = useState<string>();\n const [pipelinesData, setPipelinesData] = useState<\n TektonResponseData | undefined\n >();\n\n const mounted = useRef(false);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const watchResourcesData = useAllWatchResources(\n { kubernetesObjects, loading, error },\n selectedCluster,\n watchedResource,\n );\n\n const resourcesClusters = useResourcesClusters({\n kubernetesObjects,\n loading,\n error,\n });\n\n const updateResults = useCallback(\n (\n resData: TektonResponseData,\n isLoading: boolean,\n errorData: string | undefined,\n ) => {\n if (!isLoading && !errorData && mounted.current) {\n setLoaded(true);\n setPipelinesData(prevPipelinesData => {\n if (isEqual(prevPipelinesData, resData)) {\n return prevPipelinesData;\n }\n return resData;\n });\n } else if (errorData && mounted.current) {\n setLoaded(true);\n setErrorState(errorData);\n }\n },\n [setLoaded, setPipelinesData, setErrorState],\n );\n\n const debouncedUpdateResources = useDebounceCallback(updateResults, 250);\n\n useEffect(() => {\n debouncedUpdateResources?.(watchResourcesData, loading, error);\n }, [debouncedUpdateResources, watchResourcesData, loading, error]);\n\n return useDeepCompareMemoize({\n watchResourcesData: pipelinesData,\n loaded,\n responseError: errorState,\n selectedClusterErrors: resourcesClusters?.errors?.[selectedCluster] ?? [],\n clusters: resourcesClusters?.clusters || [],\n selectedCluster,\n setSelectedCluster,\n selectedStatus,\n setSelectedStatus,\n isExpanded,\n setIsExpanded,\n });\n};\n"],"names":[],"mappings":";;;;;;;;AAgCO,MAAM,wBAAA,GAA2B,CACtC,eAAA,KAC+B;AAC/B,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,iBAAA,EAAmB,OAAA,EAAS,KAAA,EAAM,GAAI,qBAAqB,MAAM,CAAA;AACzE,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAiB,CAAC,CAAA;AAChE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,QAAA;AAAA,IAC1C;AAAA,GACF;AACA,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC3D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAkB,KAAK,CAAA;AACnD,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAA,EAAiB;AACrD,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAA,EAExC;AAEF,EAAA,MAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AAE5B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAClB,IAAA,OAAO,MAAM;AACX,MAAA,OAAA,CAAQ,OAAA,GAAU,KAAA;AAAA,IACpB,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,MAA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EAAmB,MAAA,GAAS,eAAe,KAAK,EAAC;AAAA,IACxE,QAAA,EAAU,iBAAA,EAAmB,QAAA,IAAY,EAAC;AAAA,IAC1C,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTektonViewPermission.esm.js","sources":["../../src/hooks/useTektonViewPermission.ts"],"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 { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n} from '@backstage/plugin-kubernetes-common';\n\nexport const useTektonViewPermission = () => {\n const clusterReadPermission = usePermission({\n permission: kubernetesClustersReadPermission,\n });\n\n const clusterResourcesReadPermission = usePermission({\n permission: kubernetesResourcesReadPermission,\n });\n\n return {\n loading:\n clusterReadPermission.loading || clusterResourcesReadPermission.loading,\n allowed:\n clusterReadPermission.allowed && clusterResourcesReadPermission.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAsBO,MAAM,0BAA0B,MAAM;AAC3C,EAAA,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"useTektonViewPermission.esm.js","sources":["../../src/hooks/useTektonViewPermission.ts"],"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 { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n kubernetesClustersReadPermission,\n kubernetesResourcesReadPermission,\n} from '@backstage/plugin-kubernetes-common';\n\nexport const useTektonViewPermission = () => {\n const clusterReadPermission = usePermission({\n permission: kubernetesClustersReadPermission,\n });\n\n const clusterResourcesReadPermission = usePermission({\n permission: kubernetesResourcesReadPermission,\n });\n\n return {\n loading:\n clusterReadPermission.loading || clusterResourcesReadPermission.loading,\n allowed:\n clusterReadPermission.allowed && clusterResourcesReadPermission.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAsBO,MAAM,0BAA0B,MAAM;AAC3C,EAAA,MAAM,wBAAwB,aAAA,CAAc;AAAA,IAC1C,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,MAAM,iCAAiC,aAAA,CAAc;AAAA,IACnD,UAAA,EAAY;AAAA,GACb,CAAA;AAED,EAAA,OAAO;AAAA,IACL,OAAA,EACE,qBAAA,CAAsB,OAAA,IAAW,8BAAA,CAA+B,OAAA;AAAA,IAClE,OAAA,EACE,qBAAA,CAAsB,OAAA,IAAW,8BAAA,CAA+B;AAAA,GACpE;AACF;;;;"}
|
package/dist/models.esm.js
CHANGED
package/dist/models.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.esm.js","sources":["../src/models.ts"],"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 { GroupVersionKind, tektonGroupColor } from './types/types';\n\nexport const PipelineRunGVK: GroupVersionKind = {\n apiVersion: 'v1',\n apiGroup: 'tekton.dev',\n kind: 'PipelineRun',\n};\n\nexport const PipelineRunModel = {\n ...PipelineRunGVK,\n abbr: 'PLR',\n color: tektonGroupColor,\n};\n\nexport const TaskRunGVK: GroupVersionKind = {\n apiVersion: 'v1',\n apiGroup: 'tekton.dev',\n kind: 'TaskRun',\n};\n\nexport enum ModelsPlural {\n pipelineruns = 'pipelineruns',\n taskruns = 'taskruns',\n pods = 'pods',\n}\n\nexport const tektonResourceModels: { [key: string]: GroupVersionKind } = {\n [ModelsPlural.pipelineruns]: PipelineRunGVK,\n [ModelsPlural.taskruns]: TaskRunGVK,\n};\n"],"names":["ModelsPlural"],"mappings":"
|
|
1
|
+
{"version":3,"file":"models.esm.js","sources":["../src/models.ts"],"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 { GroupVersionKind, tektonGroupColor } from './types/types';\n\nexport const PipelineRunGVK: GroupVersionKind = {\n apiVersion: 'v1',\n apiGroup: 'tekton.dev',\n kind: 'PipelineRun',\n};\n\nexport const PipelineRunModel = {\n ...PipelineRunGVK,\n abbr: 'PLR',\n color: tektonGroupColor,\n};\n\nexport const TaskRunGVK: GroupVersionKind = {\n apiVersion: 'v1',\n apiGroup: 'tekton.dev',\n kind: 'TaskRun',\n};\n\nexport enum ModelsPlural {\n pipelineruns = 'pipelineruns',\n taskruns = 'taskruns',\n pods = 'pods',\n}\n\nexport const tektonResourceModels: { [key: string]: GroupVersionKind } = {\n [ModelsPlural.pipelineruns]: PipelineRunGVK,\n [ModelsPlural.taskruns]: TaskRunGVK,\n};\n"],"names":["ModelsPlural"],"mappings":"AAiBO,MAAM,cAAA,GAAmC;AAAA,EAG9C,IAAA,EAAM;AACR;AAQO,MAAM,UAAA,GAA+B;AAAA,EAG1C,IAAA,EAAM;AACR;AAEO,IAAK,YAAA,qBAAAA,aAAAA,KAAL;AACL,EAAAA,cAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,cAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,cAAA,MAAA,CAAA,GAAO,MAAA;AAHG,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO;;
|
|
1
|
+
{"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;","x_google_ignoreList":[0]}
|
package/dist/plugin.esm.js
CHANGED
|
@@ -1,63 +1,7 @@
|
|
|
1
|
-
import { createPlugin,
|
|
2
|
-
import { KubernetesAuthProviders, KubernetesBackendClient, KubernetesProxyClient } from '@backstage/plugin-kubernetes-react';
|
|
3
|
-
import { kubernetesAuthProvidersApiRef, kubernetesApiRef, kubernetesProxyApiRef } from './types/types.esm.js';
|
|
1
|
+
import { createPlugin, createComponentExtension } from '@backstage/core-plugin-api';
|
|
4
2
|
|
|
5
3
|
const tektonPlugin = createPlugin({
|
|
6
|
-
id: "tekton"
|
|
7
|
-
apis: [
|
|
8
|
-
createApiFactory({
|
|
9
|
-
api: kubernetesAuthProvidersApiRef,
|
|
10
|
-
deps: {
|
|
11
|
-
gitlabAuthApi: gitlabAuthApiRef,
|
|
12
|
-
googleAuthApi: googleAuthApiRef,
|
|
13
|
-
microsoftAuthApi: microsoftAuthApiRef,
|
|
14
|
-
oktaAuthApi: oktaAuthApiRef,
|
|
15
|
-
oneloginAuthApi: oneloginAuthApiRef
|
|
16
|
-
},
|
|
17
|
-
factory: ({
|
|
18
|
-
gitlabAuthApi,
|
|
19
|
-
googleAuthApi,
|
|
20
|
-
microsoftAuthApi,
|
|
21
|
-
oktaAuthApi,
|
|
22
|
-
oneloginAuthApi
|
|
23
|
-
}) => {
|
|
24
|
-
const oidcProviders = {
|
|
25
|
-
gitlab: gitlabAuthApi,
|
|
26
|
-
google: googleAuthApi,
|
|
27
|
-
microsoft: microsoftAuthApi,
|
|
28
|
-
okta: oktaAuthApi,
|
|
29
|
-
onelogin: oneloginAuthApi
|
|
30
|
-
};
|
|
31
|
-
return new KubernetesAuthProviders({
|
|
32
|
-
microsoftAuthApi,
|
|
33
|
-
googleAuthApi,
|
|
34
|
-
oidcProviders
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}),
|
|
38
|
-
createApiFactory({
|
|
39
|
-
api: kubernetesApiRef,
|
|
40
|
-
deps: {
|
|
41
|
-
discoveryApi: discoveryApiRef,
|
|
42
|
-
fetchApi: fetchApiRef,
|
|
43
|
-
kubernetesAuthProvidersApi: kubernetesAuthProvidersApiRef
|
|
44
|
-
},
|
|
45
|
-
factory: ({ discoveryApi, fetchApi, kubernetesAuthProvidersApi }) => new KubernetesBackendClient({
|
|
46
|
-
discoveryApi,
|
|
47
|
-
fetchApi,
|
|
48
|
-
kubernetesAuthProvidersApi
|
|
49
|
-
})
|
|
50
|
-
}),
|
|
51
|
-
createApiFactory({
|
|
52
|
-
api: kubernetesProxyApiRef,
|
|
53
|
-
deps: {
|
|
54
|
-
kubernetesApi: kubernetesApiRef
|
|
55
|
-
},
|
|
56
|
-
factory: ({ kubernetesApi }) => new KubernetesProxyClient({
|
|
57
|
-
kubernetesApi
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
]
|
|
4
|
+
id: "tekton"
|
|
61
5
|
});
|
|
62
6
|
const TektonCI = tektonPlugin.provide(
|
|
63
7
|
createComponentExtension({
|