@backstage-community/plugin-github-actions 0.6.18 → 0.6.19
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 +6 -0
- package/alpha/package.json +1 -1
- package/dist/components/Cards/Cards.esm.js +2 -1
- package/dist/components/Cards/Cards.esm.js.map +1 -1
- package/dist/components/Cards/RecentWorkflowRunsCard.esm.js +6 -1
- package/dist/components/Cards/RecentWorkflowRunsCard.esm.js.map +1 -1
- package/dist/components/WorkflowRunStatus/WorkflowRunStatus.esm.js +12 -1
- package/dist/components/WorkflowRunStatus/WorkflowRunStatus.esm.js.map +1 -1
- package/dist/components/WorkflowRunsCard/WorkflowRunsCard.esm.js +83 -68
- package/dist/components/WorkflowRunsCard/WorkflowRunsCard.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/alpha/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { WorkflowRunStatus } from '../WorkflowRunStatus/WorkflowRunStatus.esm.js
|
|
|
11
11
|
import { useApi, errorApiRef } from '@backstage/core-plugin-api';
|
|
12
12
|
import { InfoCard, StructuredMetadataTable, Link } from '@backstage/core-components';
|
|
13
13
|
import { getHostnameFromEntity } from '../getHostnameFromEntity.esm.js';
|
|
14
|
+
import Box from '@material-ui/core/Box';
|
|
14
15
|
|
|
15
16
|
const useStyles = makeStyles({
|
|
16
17
|
externalLinkIcon: {
|
|
@@ -27,7 +28,7 @@ const WidgetContent = (props) => {
|
|
|
27
28
|
StructuredMetadataTable,
|
|
28
29
|
{
|
|
29
30
|
metadata: {
|
|
30
|
-
status: /* @__PURE__ */ React.createElement(
|
|
31
|
+
status: /* @__PURE__ */ React.createElement(Box, { display: "flex" }, /* @__PURE__ */ React.createElement(
|
|
31
32
|
WorkflowRunStatus,
|
|
32
33
|
{
|
|
33
34
|
status: lastRun.status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cards.esm.js","sources":["../../../src/components/Cards/Cards.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExternalLinkIcon from '@material-ui/icons/Launch';\nimport React, { useEffect } from 'react';\nimport { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunsTable } from '../WorkflowRunsTable';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n StructuredMetadataTable,\n} from '@backstage/core-components';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\n\nconst useStyles = makeStyles({\n externalLinkIcon: {\n fontSize: 'inherit',\n verticalAlign: 'bottom',\n },\n});\n\nconst WidgetContent = (props: {\n error?: Error;\n loading?: boolean;\n lastRun: WorkflowRun;\n branch: string;\n}) => {\n const { error, loading, lastRun, branch } = props;\n const classes = useStyles();\n\n if (error) return <Typography>Couldn't fetch latest {branch} run</Typography>;\n if (loading) return <LinearProgress />;\n\n return (\n <StructuredMetadataTable\n metadata={{\n status: (\n
|
|
1
|
+
{"version":3,"file":"Cards.esm.js","sources":["../../../src/components/Cards/Cards.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExternalLinkIcon from '@material-ui/icons/Launch';\nimport React, { useEffect } from 'react';\nimport { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunsTable } from '../WorkflowRunsTable';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n StructuredMetadataTable,\n} from '@backstage/core-components';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\nimport Box from '@material-ui/core/Box';\n\nconst useStyles = makeStyles({\n externalLinkIcon: {\n fontSize: 'inherit',\n verticalAlign: 'bottom',\n },\n});\n\nconst WidgetContent = (props: {\n error?: Error;\n loading?: boolean;\n lastRun: WorkflowRun;\n branch: string;\n}) => {\n const { error, loading, lastRun, branch } = props;\n const classes = useStyles();\n\n if (error) return <Typography>Couldn't fetch latest {branch} run</Typography>;\n if (loading) return <LinearProgress />;\n\n return (\n <StructuredMetadataTable\n metadata={{\n status: (\n <Box display=\"flex\">\n <WorkflowRunStatus\n status={lastRun.status}\n conclusion={lastRun.conclusion}\n />\n </Box>\n ),\n message: lastRun.message,\n url: (\n <Link to={lastRun.githubUrl ?? ''}>\n See more on GitHub{' '}\n <ExternalLinkIcon className={classes.externalLinkIcon} />\n </Link>\n ),\n }}\n />\n );\n};\n\n/** @public */\nexport const LatestWorkflowRunCard = (props: {\n branch?: string;\n variant?: InfoCardVariants;\n}) => {\n const { branch = 'master', variant } = props;\n const { entity } = useEntity();\n const errorApi = useApi(errorApiRef);\n const hostname = getHostnameFromEntity(entity);\n const [owner, repo] = (\n entity?.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] ?? '/'\n ).split('/');\n const [{ runs, loading, error }] = useWorkflowRuns({\n hostname,\n owner,\n repo,\n branch,\n });\n const lastRun = runs?.[0] ?? ({} as WorkflowRun);\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n return (\n <InfoCard title={`Last ${branch} build`} variant={variant}>\n <WidgetContent\n error={error}\n loading={loading}\n branch={branch}\n lastRun={lastRun}\n />\n </InfoCard>\n );\n};\n\n/** @public */\nexport const LatestWorkflowsForBranchCard = (props: {\n branch?: string;\n variant?: InfoCardVariants;\n}) => {\n const { branch = 'master', variant } = props;\n const { entity } = useEntity();\n\n return (\n <InfoCard title={`Last ${branch} build`} variant={variant}>\n <WorkflowRunsTable branch={branch} entity={entity} />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,gBAAkB,EAAA;AAAA,IAChB,QAAU,EAAA,SAAA;AAAA,IACV,aAAe,EAAA,QAAA;AAAA,GACjB;AACF,CAAC,CAAA,CAAA;AAED,MAAM,aAAA,GAAgB,CAAC,KAKjB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,OAAA,EAAS,QAAW,GAAA,KAAA,CAAA;AAC5C,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EAAA,IAAI,OAAc,uBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,IAAA,EAAA,wBAAA,EAAuB,QAAO,MAAI,CAAA,CAAA;AAChE,EAAI,IAAA,OAAA,EAAgB,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAA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A,IACjD,QAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA;AAAA,GACD,CAAA,CAAA;AACD,EAAA,MAAM,OAAU,GAAA,IAAA,GAAO,CAAC,CAAA,IAAM,EAAC,CAAA;AAC/B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,QAAA,CAAS,KAAK,KAAK,CAAA,CAAA;AAAA,KACrB;AAAA,GACC,EAAA,CAAC,KAAO,EAAA,QAAQ,CAAC,CAAA,CAAA;AAEpB,EAAA,2CACG,QAAS,EAAA,EAAA,KAAA,EAAO,CAAQ,KAAA,EAAA,MAAM,UAAU,OACvC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,KAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ,EAAA;AAGa,MAAA,4BAAA,GAA+B,CAAC,KAGvC,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,GAAS,QAAU,EAAA,OAAA,EAAY,GAAA,KAAA,CAAA;AACvC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAE7B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,KAAA,EAAO,CAAQ,KAAA,EAAA,MAAM,CAAU,MAAA,CAAA,EAAA,OAAA,EAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,MAAgB,EAAA,MAAA,EAAgB,CACrD,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -9,6 +9,7 @@ import { useApi, errorApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
|
9
9
|
import { ErrorPanel, InfoCard, Link, Table } from '@backstage/core-components';
|
|
10
10
|
import { buildRouteRef } from '../../routes.esm.js';
|
|
11
11
|
import { getHostnameFromEntity } from '../getHostnameFromEntity.esm.js';
|
|
12
|
+
import Box from '@material-ui/core/Box';
|
|
12
13
|
|
|
13
14
|
const firstLine = (message) => message.split("\n")[0];
|
|
14
15
|
const RecentWorkflowRunsCard = (props) => {
|
|
@@ -59,7 +60,11 @@ const RecentWorkflowRunsCard = (props) => {
|
|
|
59
60
|
render: (data) => /* @__PURE__ */ React.createElement(Link, { component: Link$1, to: routeLink({ id: data.id }) }, firstLine(data.message ?? ""))
|
|
60
61
|
},
|
|
61
62
|
{ title: "Branch", field: "source.branchName" },
|
|
62
|
-
{
|
|
63
|
+
{
|
|
64
|
+
title: "Status",
|
|
65
|
+
field: "status",
|
|
66
|
+
render: (p) => /* @__PURE__ */ React.createElement(Box, { display: "flex" }, /* @__PURE__ */ React.createElement(WorkflowRunStatus, { ...p }))
|
|
67
|
+
}
|
|
63
68
|
],
|
|
64
69
|
data: runs
|
|
65
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecentWorkflowRunsCard.esm.js","sources":["../../../src/components/Cards/RecentWorkflowRunsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useEntity } from '@backstage/plugin-catalog-react';\nimport React, { useEffect } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport Typography from '@material-ui/core/Typography';\n\nimport { errorApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n ErrorPanel,\n InfoCard,\n InfoCardVariants,\n Link,\n Table,\n} from '@backstage/core-components';\nimport { buildRouteRef } from '../../routes';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\n\nconst firstLine = (message: string): string => message.split('\\n')[0];\n\n/** @public */\nexport const RecentWorkflowRunsCard = (props: {\n branch?: string;\n dense?: boolean;\n limit?: number;\n variant?: InfoCardVariants;\n}) => {\n const { branch, dense = false, limit = 5, variant } = props;\n\n const { entity } = useEntity();\n const errorApi = useApi(errorApiRef);\n\n const hostname = getHostnameFromEntity(entity);\n\n const [owner, repo] = (\n entity?.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] ?? '/'\n ).split('/');\n\n const [{ runs = [], loading, error }] = useWorkflowRuns({\n hostname,\n owner,\n repo,\n branch,\n initialPageSize: limit,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n const githubHost = hostname || 'github.com';\n const routeLink = useRouteRef(buildRouteRef);\n\n if (error) {\n return <ErrorPanel title={error.message} error={error} />;\n }\n\n return (\n <InfoCard\n title=\"Recent Workflow Runs\"\n subheader={branch ? `Branch: ${branch}` : 'All Branches'}\n noPadding\n variant={variant}\n >\n {!runs.length ? (\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This component has GitHub Actions enabled, but no workflows were\n found.\n </Typography>\n <Typography variant=\"body2\">\n <Link to={`https://${githubHost}/${owner}/${repo}/actions/new`}>\n Create a new workflow\n </Link>\n </Typography>\n </div>\n ) : (\n <Table<WorkflowRun>\n isLoading={loading}\n options={{\n search: false,\n paging: false,\n padding: dense ? 'dense' : 'default',\n toolbar: false,\n }}\n columns={[\n {\n title: 'Commit Message',\n field: 'message',\n render: data => (\n <Link component={RouterLink} to={routeLink({ id: data.id! })}>\n {firstLine(data.message ?? '')}\n </Link>\n ),\n },\n { title: 'Branch', field: 'source.branchName' },\n {
|
|
1
|
+
{"version":3,"file":"RecentWorkflowRunsCard.esm.js","sources":["../../../src/components/Cards/RecentWorkflowRunsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useEntity } from '@backstage/plugin-catalog-react';\nimport React, { useEffect } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport Typography from '@material-ui/core/Typography';\n\nimport { errorApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n ErrorPanel,\n InfoCard,\n InfoCardVariants,\n Link,\n Table,\n} from '@backstage/core-components';\nimport { buildRouteRef } from '../../routes';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\nimport Box from '@material-ui/core/Box';\n\nconst firstLine = (message: string): string => message.split('\\n')[0];\n\n/** @public */\nexport const RecentWorkflowRunsCard = (props: {\n branch?: string;\n dense?: boolean;\n limit?: number;\n variant?: InfoCardVariants;\n}) => {\n const { branch, dense = false, limit = 5, variant } = props;\n\n const { entity } = useEntity();\n const errorApi = useApi(errorApiRef);\n\n const hostname = getHostnameFromEntity(entity);\n\n const [owner, repo] = (\n entity?.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION] ?? '/'\n ).split('/');\n\n const [{ runs = [], loading, error }] = useWorkflowRuns({\n hostname,\n owner,\n repo,\n branch,\n initialPageSize: limit,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n const githubHost = hostname || 'github.com';\n const routeLink = useRouteRef(buildRouteRef);\n\n if (error) {\n return <ErrorPanel title={error.message} error={error} />;\n }\n\n return (\n <InfoCard\n title=\"Recent Workflow Runs\"\n subheader={branch ? `Branch: ${branch}` : 'All Branches'}\n noPadding\n variant={variant}\n >\n {!runs.length ? (\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This component has GitHub Actions enabled, but no workflows were\n found.\n </Typography>\n <Typography variant=\"body2\">\n <Link to={`https://${githubHost}/${owner}/${repo}/actions/new`}>\n Create a new workflow\n </Link>\n </Typography>\n </div>\n ) : (\n <Table<WorkflowRun>\n isLoading={loading}\n options={{\n search: false,\n paging: false,\n padding: dense ? 'dense' : 'default',\n toolbar: false,\n }}\n columns={[\n {\n title: 'Commit Message',\n field: 'message',\n render: data => (\n <Link component={RouterLink} to={routeLink({ id: data.id! })}>\n {firstLine(data.message ?? '')}\n </Link>\n ),\n },\n { title: 'Branch', field: 'source.branchName' },\n {\n title: 'Status',\n field: 'status',\n render: p => (\n <Box display=\"flex\">\n <WorkflowRunStatus {...p} />\n </Box>\n ),\n },\n ]}\n data={runs}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["RouterLink"],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,YAAY,CAAC,OAAA,KAA4B,QAAQ,KAAM,CAAA,IAAI,EAAE,CAAC,CAAA,CAAA;AAGvD,MAAA,sBAAA,GAAyB,CAAC,KAKjC,KAAA;AACJ,EAAA,MAAM,EAAE,MAAQ,EAAA,KAAA,GAAQ,OAAO,KAAQ,GAAA,CAAA,EAAG,SAAY,GAAA,KAAA,CAAA;AAEtD,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AAEnC,EAAM,MAAA,QAAA,GAAW,sBAAsB,MAAM,CAAA,CAAA;AAE7C,EAAM,MAAA,CAAC,KAAO,EAAA,IAAI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;;;;"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StatusPending, StatusOK, StatusError, StatusWarning, StatusAborted, StatusRunning } from '@backstage/core-components';
|
|
3
|
+
import Box from '@material-ui/core/Box';
|
|
4
|
+
import Typography from '@material-ui/core/Typography';
|
|
5
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
3
6
|
|
|
7
|
+
const useStyles = makeStyles(() => ({
|
|
8
|
+
statusIcon: {
|
|
9
|
+
"& svg": {
|
|
10
|
+
position: "static"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
4
14
|
const WorkflowRunStatus = (props) => {
|
|
5
|
-
|
|
15
|
+
const classes = useStyles();
|
|
16
|
+
return /* @__PURE__ */ React.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "center" }, /* @__PURE__ */ React.createElement(Box, { className: classes.statusIcon }, /* @__PURE__ */ React.createElement(WorkflowIcon, { ...props })), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, getStatusDescription(props)));
|
|
6
17
|
};
|
|
7
18
|
function WorkflowIcon({
|
|
8
19
|
status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowRunStatus.esm.js","sources":["../../../src/components/WorkflowRunStatus/WorkflowRunStatus.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n StatusPending,\n StatusRunning,\n StatusOK,\n StatusWarning,\n StatusAborted,\n StatusError,\n} from '@backstage/core-components';\n\nexport const WorkflowRunStatus = (props: {\n status?: string;\n conclusion?: string;\n}) => {\n return (\n
|
|
1
|
+
{"version":3,"file":"WorkflowRunStatus.esm.js","sources":["../../../src/components/WorkflowRunStatus/WorkflowRunStatus.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n StatusPending,\n StatusRunning,\n StatusOK,\n StatusWarning,\n StatusAborted,\n StatusError,\n} from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(() => ({\n statusIcon: {\n '& svg': {\n position: 'static',\n },\n },\n}));\n\nexport const WorkflowRunStatus = (props: {\n status?: string;\n conclusion?: string;\n}) => {\n const classes = useStyles();\n return (\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\">\n <Box className={classes.statusIcon}>\n <WorkflowIcon {...props} />\n </Box>\n <Typography variant=\"body2\">{getStatusDescription(props)}</Typography>\n </Box>\n );\n};\n\nexport function WorkflowIcon({\n status,\n conclusion,\n}: {\n status?: string;\n conclusion?: string;\n}) {\n if (status === undefined) return null;\n switch (status.toLocaleLowerCase('en-US')) {\n case 'queued':\n return <StatusPending />;\n\n case 'in_progress':\n return <StatusRunning />;\n case 'completed':\n switch (conclusion?.toLocaleLowerCase('en-US')) {\n case 'skipped':\n case 'cancelled':\n return <StatusAborted />;\n\n case 'timed_out':\n return <StatusWarning />;\n case 'failure':\n return <StatusError />;\n default:\n return <StatusOK />;\n }\n default:\n return <StatusPending />;\n }\n}\n\nexport function getStatusDescription({\n status,\n conclusion,\n}: {\n status?: string;\n conclusion?: string;\n}) {\n if (status === undefined) return '';\n switch (status.toLocaleLowerCase('en-US')) {\n case 'queued':\n return 'Queued';\n case 'in_progress':\n return 'In progress';\n case 'completed':\n switch (conclusion?.toLocaleLowerCase('en-US')) {\n case 'skipped':\n case 'cancelled':\n return 'Aborted';\n case 'timed_out':\n return 'Timed out';\n case 'failure':\n return 'Error';\n default:\n return 'Completed';\n }\n default:\n return 'Pending';\n }\n}\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,UAAY,EAAA;AAAA,IACV,OAAS,EAAA;AAAA,MACP,QAAU,EAAA,QAAA;AAAA,KACZ;AAAA,GACF;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,iBAAA,GAAoB,CAAC,KAG5B,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAQ,MAAO,EAAA,cAAA,EAAe,QAAS,EAAA,UAAA,EAAW,QACrD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,UAAA,EAAA,sCACrB,YAAc,EAAA,EAAA,GAAG,KAAO,EAAA,CAC3B,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAS,EAAA,EAAA,oBAAA,CAAqB,KAAK,CAAE,CAC3D,CAAA,CAAA;AAEJ,EAAA;AAEO,SAAS,YAAa,CAAA;AAAA,EAC3B,MAAA;AAAA,EACA,UAAA;AACF,CAGG,EAAA;AACD,EAAI,IAAA,MAAA,KAAW,QAAkB,OAAA,IAAA,CAAA;AACjC,EAAQ,QAAA,MAAA,CAAO,iBAAkB,CAAA,OAAO,CAAG;AAAA,IACzC,KAAK,QAAA;AACH,MAAA,2CAAQ,a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AA,CAAA;AAAA,GACX;AACF;;;;"}
|
|
@@ -3,8 +3,6 @@ import Typography from '@material-ui/core/Typography';
|
|
|
3
3
|
import Box from '@material-ui/core/Box';
|
|
4
4
|
import IconButton from '@material-ui/core/IconButton';
|
|
5
5
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
6
|
-
import Button from '@material-ui/core/Button';
|
|
7
|
-
import Chip from '@material-ui/core/Chip';
|
|
8
6
|
import ButtonGroup from '@material-ui/core/ButtonGroup';
|
|
9
7
|
import Grid from '@material-ui/core/Grid';
|
|
10
8
|
import TablePagination from '@material-ui/core/TablePagination';
|
|
@@ -13,7 +11,7 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|
|
13
11
|
import TextField from '@material-ui/core/TextField';
|
|
14
12
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
15
13
|
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
16
|
-
import { EmptyState, InfoCard, Link,
|
|
14
|
+
import { EmptyState, InfoCard, Link, LinkButton } from '@backstage/core-components';
|
|
17
15
|
import GitHubIcon from '@material-ui/icons/GitHub';
|
|
18
16
|
import RetryIcon from '@material-ui/icons/Replay';
|
|
19
17
|
import SyncIcon from '@material-ui/icons/Sync';
|
|
@@ -25,6 +23,7 @@ import { buildRouteRef } from '../../routes.esm.js';
|
|
|
25
23
|
import { getProjectNameFromEntity } from '../getProjectNameFromEntity.esm.js';
|
|
26
24
|
import { getHostnameFromEntity } from '../getHostnameFromEntity.esm.js';
|
|
27
25
|
import Alert from '@material-ui/lab/Alert';
|
|
26
|
+
import Button from '@material-ui/core/Button';
|
|
28
27
|
|
|
29
28
|
const useStyles = makeStyles(
|
|
30
29
|
(theme) => createStyles({
|
|
@@ -42,12 +41,6 @@ const useStyles = makeStyles(
|
|
|
42
41
|
fontSize: "inherit",
|
|
43
42
|
verticalAlign: "middle"
|
|
44
43
|
},
|
|
45
|
-
bottomline: {
|
|
46
|
-
display: "flex",
|
|
47
|
-
justifyContent: "space-between",
|
|
48
|
-
alignItems: "center",
|
|
49
|
-
marginTop: "-5px"
|
|
50
|
-
},
|
|
51
44
|
pagination: {
|
|
52
45
|
width: "100%"
|
|
53
46
|
}
|
|
@@ -77,80 +70,102 @@ const WorkflowRunsCardView = ({
|
|
|
77
70
|
const classes = useStyles();
|
|
78
71
|
const routeLink = useRouteRef(buildRouteRef);
|
|
79
72
|
const filteredRuns = runs?.filter((run) => matchesSearchTerm(run, searchTerm));
|
|
80
|
-
return /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, filteredRuns && runs?.length !== 0 ? filteredRuns.map((run) => /* @__PURE__ */ React.createElement(Grid, { key: run.id, item: true, container: true, xs: 12,
|
|
73
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, filteredRuns && runs?.length !== 0 ? filteredRuns.map((run) => /* @__PURE__ */ React.createElement(Grid, { key: run.id, item: true, container: true, xs: 12, lg: 6, xl: 4 }, /* @__PURE__ */ React.createElement(Box, { className: classes.card }, /* @__PURE__ */ React.createElement(
|
|
81
74
|
Box,
|
|
82
75
|
{
|
|
83
76
|
display: "flex",
|
|
84
77
|
flexDirection: "column",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
p: 2,
|
|
79
|
+
height: "100%",
|
|
80
|
+
alignItems: "center"
|
|
88
81
|
},
|
|
89
|
-
/* @__PURE__ */ React.createElement(
|
|
90
|
-
|
|
82
|
+
/* @__PURE__ */ React.createElement(
|
|
83
|
+
Box,
|
|
91
84
|
{
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
sx: { width: "100%" },
|
|
86
|
+
textAlign: "center",
|
|
87
|
+
display: "flex",
|
|
88
|
+
flexDirection: "column",
|
|
89
|
+
height: "100%"
|
|
94
90
|
},
|
|
95
91
|
/* @__PURE__ */ React.createElement(
|
|
96
|
-
|
|
92
|
+
Tooltip,
|
|
97
93
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
style: { alignItems: "center" }
|
|
94
|
+
title: run.status ?? "No Status",
|
|
95
|
+
placement: "top-start"
|
|
101
96
|
},
|
|
102
|
-
/* @__PURE__ */ React.createElement(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
/* @__PURE__ */ React.createElement(
|
|
98
|
+
Alert,
|
|
99
|
+
{
|
|
100
|
+
variant: "outlined",
|
|
101
|
+
severity: statusColors[run.conclusion],
|
|
102
|
+
style: { alignItems: "center" }
|
|
103
|
+
},
|
|
104
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, /* @__PURE__ */ React.createElement(Link, { to: routeLink({ id: run.id }) }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, run.workflowName)))
|
|
105
|
+
)
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ React.createElement(Tooltip, { title: run.message ?? "No run message" }, /* @__PURE__ */ React.createElement(Box, { display: "flex", flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", component: "span" }, "Commit"), /* @__PURE__ */ React.createElement(
|
|
108
|
+
Typography,
|
|
109
|
+
{
|
|
110
|
+
variant: "body2",
|
|
111
|
+
component: "span",
|
|
112
|
+
style: { overflowWrap: "break-word" }
|
|
113
|
+
},
|
|
114
|
+
run.source.commit.hash
|
|
115
|
+
))),
|
|
116
|
+
run.source.branchName && /* @__PURE__ */ React.createElement(Box, { display: "flex", flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", component: "span" }, "Branch"), /* @__PURE__ */ React.createElement(
|
|
117
|
+
Typography,
|
|
118
|
+
{
|
|
119
|
+
variant: "body2",
|
|
120
|
+
component: "span",
|
|
121
|
+
style: { overflowWrap: "break-word" }
|
|
122
|
+
},
|
|
123
|
+
run.source.branchName
|
|
124
|
+
)),
|
|
125
|
+
/* @__PURE__ */ React.createElement(Box, { display: "flex", flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", component: "span" }, "Workflow ID"), /* @__PURE__ */ React.createElement(
|
|
126
|
+
Typography,
|
|
127
|
+
{
|
|
128
|
+
variant: "body2",
|
|
129
|
+
component: "span",
|
|
130
|
+
style: { overflowWrap: "break-word" }
|
|
131
|
+
},
|
|
132
|
+
run.id
|
|
133
|
+
)),
|
|
111
134
|
/* @__PURE__ */ React.createElement(
|
|
112
|
-
|
|
135
|
+
WorkflowRunStatus,
|
|
113
136
|
{
|
|
114
|
-
|
|
137
|
+
status: run.status,
|
|
138
|
+
conclusion: run.conclusion
|
|
115
139
|
}
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
), /* @__PURE__ */ React.createElement(
|
|
130
|
-
Chip,
|
|
131
|
-
{
|
|
132
|
-
size: "small",
|
|
133
|
-
label: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(
|
|
134
|
-
WorkflowRunStatus,
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ React.createElement(
|
|
142
|
+
Box,
|
|
143
|
+
{
|
|
144
|
+
display: "flex",
|
|
145
|
+
flexDirection: "column",
|
|
146
|
+
justifyContent: "space-between",
|
|
147
|
+
alignItems: "center",
|
|
148
|
+
mt: "auto"
|
|
149
|
+
},
|
|
150
|
+
/* @__PURE__ */ React.createElement(Box, { marginTop: 2, marginBottom: 1 }, /* @__PURE__ */ React.createElement(
|
|
151
|
+
Button,
|
|
135
152
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
153
|
+
endIcon: /* @__PURE__ */ React.createElement(RetryIcon, null),
|
|
154
|
+
onClick: run.onReRunClick,
|
|
155
|
+
variant: "outlined"
|
|
156
|
+
},
|
|
157
|
+
"Rerun workflow"
|
|
158
|
+
)),
|
|
159
|
+
run.githubUrl && /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(
|
|
160
|
+
LinkButton,
|
|
161
|
+
{
|
|
162
|
+
to: run.githubUrl,
|
|
163
|
+
endIcon: /* @__PURE__ */ React.createElement(ExternalLinkIcon, null)
|
|
164
|
+
},
|
|
165
|
+
"View on GitHub"
|
|
139
166
|
))
|
|
140
|
-
|
|
141
|
-
)
|
|
142
|
-
ExternalLinkIcon,
|
|
143
|
-
{
|
|
144
|
-
className: classes.externalLinkIcon
|
|
145
|
-
}
|
|
146
|
-
)), /* @__PURE__ */ React.createElement(ButtonGroup, null, /* @__PURE__ */ React.createElement(Tooltip, { title: "Rerun workflow" }, /* @__PURE__ */ React.createElement(
|
|
147
|
-
IconButton,
|
|
148
|
-
{
|
|
149
|
-
onClick: run.onReRunClick,
|
|
150
|
-
style: { fontSize: "12px" }
|
|
151
|
-
},
|
|
152
|
-
/* @__PURE__ */ React.createElement(RetryIcon, null)
|
|
153
|
-
)))))
|
|
167
|
+
)
|
|
168
|
+
)
|
|
154
169
|
)))) : /* @__PURE__ */ React.createElement(Box, { p: 2 }, loading ? /* @__PURE__ */ React.createElement(CircularProgress, null) : "No matching runs found."), /* @__PURE__ */ React.createElement("div", { className: classes.pagination }, /* @__PURE__ */ React.createElement(
|
|
155
170
|
TablePagination,
|
|
156
171
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowRunsCard.esm.js","sources":["../../../src/components/WorkflowRunsCard/WorkflowRunsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 React, { ChangeEvent, useEffect, useState } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Button from '@material-ui/core/Button';\nimport Chip from '@material-ui/core/Chip';\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\nimport Grid from '@material-ui/core/Grid';\nimport TablePagination from '@material-ui/core/TablePagination';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport {\n EmptyState,\n Link,\n MarkdownContent,\n InfoCard,\n} from '@backstage/core-components';\nimport GitHubIcon from '@material-ui/icons/GitHub';\nimport RetryIcon from '@material-ui/icons/Replay';\nimport SyncIcon from '@material-ui/icons/Sync';\nimport ExternalLinkIcon from '@material-ui/icons/Launch';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport { buildRouteRef } from '../../routes';\nimport { getProjectNameFromEntity } from '../getProjectNameFromEntity';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\n\nimport Alert, { Color } from '@material-ui/lab/Alert';\nimport { Entity } from '@backstage/catalog-model';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n overflow: 'visible',\n position: 'relative',\n margin: theme.spacing(4, 1, 1),\n flex: '1',\n minWidth: '0px',\n },\n externalLinkIcon: {\n fontSize: 'inherit',\n verticalAlign: 'middle',\n },\n bottomline: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginTop: '-5px',\n },\n pagination: {\n width: '100%',\n },\n }),\n);\n\ntype WorkflowRunsCardViewProps = {\n runs?: WorkflowRun[];\n searchTerm: string;\n loading: boolean;\n onChangePageSize: (pageSize: number) => void;\n onChangePage: (page: number) => void;\n page: number;\n total: number;\n pageSize: number;\n projectName: string;\n};\n\nconst statusColors: Record<string, string> = {\n skipped: 'warning',\n canceled: 'info',\n timed_out: 'error',\n failure: 'error',\n success: 'success',\n};\n\nconst matchesSearchTerm = (run: WorkflowRun, searchTerm: string) => {\n const lowerCaseSearchTerm = searchTerm.toLocaleLowerCase();\n return (\n run.workflowName?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.source.branchName?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.status?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.id?.toLocaleLowerCase().includes(lowerCaseSearchTerm)\n );\n};\n\nexport const WorkflowRunsCardView = ({\n runs,\n searchTerm,\n loading,\n onChangePageSize,\n onChangePage,\n page,\n total,\n pageSize,\n}: WorkflowRunsCardViewProps) => {\n const classes = useStyles();\n const routeLink = useRouteRef(buildRouteRef);\n\n const filteredRuns = runs?.filter(run => matchesSearchTerm(run, searchTerm));\n\n return (\n <Grid container spacing={3}>\n {filteredRuns && runs?.length !== 0 ? (\n filteredRuns.map(run => (\n <Grid key={run.id} item container xs={12} sm={4} md={4} xl={4}>\n <Box className={classes.card}>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n m={3}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Box pt={2} sx={{ width: '100%' }} textAlign=\"center\">\n <Tooltip\n title={run.status ?? 'No Status'}\n placement=\"top-start\"\n >\n <Alert\n variant=\"outlined\"\n severity={\n statusColors[\n run.conclusion as keyof typeof statusColors\n ] as Color\n }\n style={{ alignItems: 'center' }}\n >\n <Typography variant=\"h6\">\n <Link to={routeLink({ id: run.id })}>\n <Typography color=\"primary\" variant=\"h6\">\n {run.workflowName}\n </Typography>\n </Link>\n </Typography>\n </Alert>\n </Tooltip>\n <Tooltip title={run.message ?? 'No run message'}>\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ fontSize: 'smaller' }}\n >\n <MarkdownContent\n content={`Commit ID : ${run.source.commit.hash!}`}\n />\n </Typography>\n </Tooltip>\n\n {run.source.branchName && (\n <MarkdownContent\n content={`Branch : ${run.source.branchName}`}\n />\n )}\n <Chip\n key={run.id}\n size=\"small\"\n label={`Workflow ID : ${run.id}`}\n />\n <Chip\n size=\"small\"\n label={\n <Box display=\"flex\" alignItems=\"center\">\n <WorkflowRunStatus\n status={run.status}\n conclusion={run.conclusion}\n />\n </Box>\n }\n />\n <div className={classes.bottomline}>\n {run.githubUrl && (\n <Link to={run.githubUrl}>\n Workflow runs on GitHub{' '}\n <ExternalLinkIcon\n className={classes.externalLinkIcon}\n />\n </Link>\n )}\n <ButtonGroup>\n <Tooltip title=\"Rerun workflow\">\n <IconButton\n onClick={run.onReRunClick}\n style={{ fontSize: '12px' }}\n >\n <RetryIcon />\n </IconButton>\n </Tooltip>\n </ButtonGroup>\n </div>\n </Box>\n </Box>\n </Box>\n </Grid>\n ))\n ) : (\n <Box p={2}>\n {loading ? <CircularProgress /> : 'No matching runs found.'}\n </Box>\n )}\n <div className={classes.pagination}>\n <TablePagination\n component=\"div\"\n count={total}\n page={page}\n rowsPerPage={pageSize}\n onPageChange={(_, newPage) => onChangePage(newPage)}\n onRowsPerPageChange={event =>\n onChangePageSize(parseInt(event.target.value, 6))\n }\n labelRowsPerPage=\"Workflows per page\"\n rowsPerPageOptions={[6, 12, 18, { label: 'All', value: -1 }]}\n />\n </div>\n </Grid>\n );\n};\n\ntype WorkflowRunsCardProps = {\n entity: Entity;\n};\n\nconst WorkflowRunsCardSearch = ({\n searchTerm,\n handleSearch,\n retry,\n}: {\n searchTerm: string;\n handleSearch: (event: ChangeEvent<HTMLInputElement>) => void;\n retry: () => void;\n}) => {\n return (\n <>\n <Box flexGrow={1} />\n <TextField\n type=\"search\"\n label=\"Search\"\n value={searchTerm}\n onChange={handleSearch}\n data-testid=\"search-control\"\n style={{ marginRight: '20px' }}\n />\n <ButtonGroup>\n <Tooltip title=\"Reload workflow runs\">\n <IconButton onClick={retry}>\n <SyncIcon />\n </IconButton>\n </Tooltip>\n </ButtonGroup>\n </>\n );\n};\n\nexport const WorkflowRunsCard = ({ entity }: WorkflowRunsCardProps) => {\n const projectName = getProjectNameFromEntity(entity);\n const hostname = getHostnameFromEntity(entity);\n const [owner, repo] = (projectName ?? '/').split('/');\n const [branch, setBranch] = useState<string | undefined>('default');\n const [runs, setRuns] = useState<WorkflowRun[] | undefined>([]);\n const [searchTerm, setSearchTerm] = useState('');\n\n const handleSearch = (event: ChangeEvent<HTMLInputElement>) => {\n setSearchTerm(event.target.value);\n };\n\n const [\n { runs: runsData, branches, defaultBranch, ...cardProps },\n { retry, setPage, setPageSize },\n ] = useWorkflowRuns({\n hostname,\n owner,\n repo,\n branch: branch === 'all' ? undefined : branch,\n });\n\n const githubHost = hostname || 'github.com';\n const hasNoRuns = !cardProps.loading && !runsData;\n\n const handleMenuChange = (\n event: ChangeEvent<{ name?: string; value: unknown }>,\n ) => {\n const selectedValue = event.target.value as string;\n setBranch(selectedValue);\n setPage(0);\n retry();\n };\n\n useEffect(() => {\n setRuns(runsData);\n }, [runsData, branch]);\n\n useEffect(() => {\n setBranch(defaultBranch);\n }, [defaultBranch]);\n\n return (\n <Grid item>\n {hasNoRuns ? (\n <EmptyState\n missing=\"data\"\n title=\"No Workflow Data\"\n description=\"This component has GitHub Actions enabled, but no data was found. Have you created any Workflows? Click the button below to create a new Workflow.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href={`https://${githubHost}/${projectName}/actions/new`}\n >\n Create new Workflow\n </Button>\n }\n />\n ) : (\n <InfoCard\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <GitHubIcon />\n <Box mr={1} />\n <Typography variant=\"h6\">{projectName}</Typography>\n\n <Select\n value={branch}\n key={branch}\n label=\"Branch\"\n onChange={handleMenuChange}\n data-testid=\"menu-control\"\n style={{\n marginLeft: '30px',\n marginRight: '20px',\n width: '230px',\n }}\n >\n {branches.map(branchItem => (\n <MenuItem key={branchItem.name} value={branchItem.name}>\n {branchItem.name === defaultBranch ? (\n <Typography variant=\"body2\" component=\"span\">\n {branchItem.name}{' '}\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ color: 'lightgray', fontSize: 'x-small' }}\n >\n (default)\n </Typography>\n </Typography>\n ) : (\n branchItem.name\n )}\n </MenuItem>\n ))}\n\n <MenuItem\n value=\"all\"\n key=\"all\"\n style={{ color: 'lightGrey', fontSize: 'small' }}\n >\n select all branches\n </MenuItem>\n </Select>\n\n <WorkflowRunsCardSearch\n searchTerm={searchTerm}\n handleSearch={handleSearch}\n retry={retry}\n />\n </Box>\n }\n >\n <WorkflowRunsCardView\n runs={runs}\n loading={cardProps.loading}\n onChangePageSize={setPageSize}\n onChangePage={setPage}\n page={cardProps.page}\n total={cardProps.total}\n pageSize={cardProps.pageSize}\n searchTerm={searchTerm}\n projectName={projectName}\n />\n </InfoCard>\n )}\n </Grid>\n );\n};\n\nexport default WorkflowRunsCard;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,OAAO,CAAA,CAAA;AAAA,MAC1C,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC1B,YAAc,EAAA,KAAA;AAAA,MACd,QAAU,EAAA,SAAA;AAAA,MACV,QAAU,EAAA,UAAA;AAAA,MACV,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,MAC7B,IAAM,EAAA,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,KAAA;AAAA,YACN,GAAI,EAAA,KAAA;AAAA,YACJ,KAAO,EAAA,EAAE,KAAO,EAAA,WAAA,EAAa,UAAU,OAAQ,EAAA;AAAA,WAAA;AAAA,UAChD,qBAAA;AAAA,SAED;AAAA,OAGF,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,sBAAA;AAAA,QAAA;AAAA,UACC,UAAA;AAAA,UACA,YAAA;AAAA,UACA,KAAA;AAAA,SAAA;AAAA,OAEJ,CAAA;AAAA,KAAA;AAAA,oBAGF,KAAA,CAAA,aAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,SAAS,SAAU,CAAA,OAAA;AAAA,QACnB,gBAAkB,EAAA,WAAA;AAAA,QAClB,YAAc,EAAA,OAAA;AAAA,QACd,MAAM,SAAU,CAAA,IAAA;AAAA,QAChB,OAAO,SAAU,CAAA,KAAA;AAAA,QACjB,UAAU,SAAU,CAAA,QAAA;AAAA,QACpB,UAAA;AAAA,QACA,WAAA;AAAA,OAAA;AAAA,KACF;AAAA,GAGN,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"WorkflowRunsCard.esm.js","sources":["../../../src/components/WorkflowRunsCard/WorkflowRunsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 React, { ChangeEvent, useEffect, useState } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\nimport Grid from '@material-ui/core/Grid';\nimport TablePagination from '@material-ui/core/TablePagination';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport {\n LinkButton,\n EmptyState,\n Link,\n InfoCard,\n} from '@backstage/core-components';\nimport GitHubIcon from '@material-ui/icons/GitHub';\nimport RetryIcon from '@material-ui/icons/Replay';\nimport SyncIcon from '@material-ui/icons/Sync';\nimport ExternalLinkIcon from '@material-ui/icons/Launch';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';\nimport { WorkflowRunStatus } from '../WorkflowRunStatus';\nimport { buildRouteRef } from '../../routes';\nimport { getProjectNameFromEntity } from '../getProjectNameFromEntity';\nimport { getHostnameFromEntity } from '../getHostnameFromEntity';\n\nimport Alert, { Color } from '@material-ui/lab/Alert';\nimport { Entity } from '@backstage/catalog-model';\nimport Button from '@material-ui/core/Button';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n card: {\n border: `1px solid ${theme.palette.divider}`,\n boxShadow: theme.shadows[2],\n borderRadius: '4px',\n overflow: 'visible',\n position: 'relative',\n margin: theme.spacing(4, 1, 1),\n flex: '1',\n minWidth: '0px',\n },\n externalLinkIcon: {\n fontSize: 'inherit',\n verticalAlign: 'middle',\n },\n pagination: {\n width: '100%',\n },\n }),\n);\n\ntype WorkflowRunsCardViewProps = {\n runs?: WorkflowRun[];\n searchTerm: string;\n loading: boolean;\n onChangePageSize: (pageSize: number) => void;\n onChangePage: (page: number) => void;\n page: number;\n total: number;\n pageSize: number;\n projectName: string;\n};\n\nconst statusColors: Record<string, string> = {\n skipped: 'warning',\n canceled: 'info',\n timed_out: 'error',\n failure: 'error',\n success: 'success',\n};\n\nconst matchesSearchTerm = (run: WorkflowRun, searchTerm: string) => {\n const lowerCaseSearchTerm = searchTerm.toLocaleLowerCase();\n return (\n run.workflowName?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.source.branchName?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.status?.toLocaleLowerCase().includes(lowerCaseSearchTerm) ||\n run.id?.toLocaleLowerCase().includes(lowerCaseSearchTerm)\n );\n};\n\nexport const WorkflowRunsCardView = ({\n runs,\n searchTerm,\n loading,\n onChangePageSize,\n onChangePage,\n page,\n total,\n pageSize,\n}: WorkflowRunsCardViewProps) => {\n const classes = useStyles();\n const routeLink = useRouteRef(buildRouteRef);\n\n const filteredRuns = runs?.filter(run => matchesSearchTerm(run, searchTerm));\n\n return (\n <Grid container spacing={3}>\n {filteredRuns && runs?.length !== 0 ? (\n filteredRuns.map(run => (\n <Grid key={run.id} item container xs={12} lg={6} xl={4}>\n <Box className={classes.card}>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n p={2}\n height=\"100%\"\n alignItems=\"center\"\n >\n <Box\n sx={{ width: '100%' }}\n textAlign=\"center\"\n display=\"flex\"\n flexDirection=\"column\"\n height=\"100%\"\n >\n <Tooltip\n title={run.status ?? 'No Status'}\n placement=\"top-start\"\n >\n <Alert\n variant=\"outlined\"\n severity={\n statusColors[\n run.conclusion as keyof typeof statusColors\n ] as Color\n }\n style={{ alignItems: 'center' }}\n >\n <Typography variant=\"h6\">\n <Link to={routeLink({ id: run.id })}>\n <Typography variant=\"h6\">\n {run.workflowName}\n </Typography>\n </Link>\n </Typography>\n </Alert>\n </Tooltip>\n <Tooltip title={run.message ?? 'No run message'}>\n <Box display=\"flex\" flexDirection=\"column\" marginY={1}>\n <Typography variant=\"subtitle2\" component=\"span\">\n Commit\n </Typography>\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ overflowWrap: 'break-word' }}\n >\n {run.source.commit.hash!}\n </Typography>\n </Box>\n </Tooltip>\n\n {run.source.branchName && (\n <Box display=\"flex\" flexDirection=\"column\" marginY={1}>\n <Typography variant=\"subtitle2\" component=\"span\">\n Branch\n </Typography>\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ overflowWrap: 'break-word' }}\n >\n {run.source.branchName}\n </Typography>\n </Box>\n )}\n <Box display=\"flex\" flexDirection=\"column\" marginY={1}>\n <Typography variant=\"subtitle2\" component=\"span\">\n Workflow ID\n </Typography>\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ overflowWrap: 'break-word' }}\n >\n {run.id}\n </Typography>\n </Box>\n <WorkflowRunStatus\n status={run.status}\n conclusion={run.conclusion}\n />\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n mt=\"auto\"\n >\n <Box marginTop={2} marginBottom={1}>\n <Button\n endIcon={<RetryIcon />}\n onClick={run.onReRunClick}\n variant=\"outlined\"\n >\n Rerun workflow\n </Button>\n </Box>\n\n {run.githubUrl && (\n <Box>\n <LinkButton\n to={run.githubUrl}\n endIcon={<ExternalLinkIcon />}\n >\n View on GitHub\n </LinkButton>\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n </Box>\n </Grid>\n ))\n ) : (\n <Box p={2}>\n {loading ? <CircularProgress /> : 'No matching runs found.'}\n </Box>\n )}\n <div className={classes.pagination}>\n <TablePagination\n component=\"div\"\n count={total}\n page={page}\n rowsPerPage={pageSize}\n onPageChange={(_, newPage) => onChangePage(newPage)}\n onRowsPerPageChange={event =>\n onChangePageSize(parseInt(event.target.value, 6))\n }\n labelRowsPerPage=\"Workflows per page\"\n rowsPerPageOptions={[6, 12, 18, { label: 'All', value: -1 }]}\n />\n </div>\n </Grid>\n );\n};\n\ntype WorkflowRunsCardProps = {\n entity: Entity;\n};\n\nconst WorkflowRunsCardSearch = ({\n searchTerm,\n handleSearch,\n retry,\n}: {\n searchTerm: string;\n handleSearch: (event: ChangeEvent<HTMLInputElement>) => void;\n retry: () => void;\n}) => {\n return (\n <>\n <Box flexGrow={1} />\n <TextField\n type=\"search\"\n label=\"Search\"\n value={searchTerm}\n onChange={handleSearch}\n data-testid=\"search-control\"\n style={{ marginRight: '20px' }}\n />\n <ButtonGroup>\n <Tooltip title=\"Reload workflow runs\">\n <IconButton onClick={retry}>\n <SyncIcon />\n </IconButton>\n </Tooltip>\n </ButtonGroup>\n </>\n );\n};\n\nexport const WorkflowRunsCard = ({ entity }: WorkflowRunsCardProps) => {\n const projectName = getProjectNameFromEntity(entity);\n const hostname = getHostnameFromEntity(entity);\n const [owner, repo] = (projectName ?? '/').split('/');\n const [branch, setBranch] = useState<string | undefined>('default');\n const [runs, setRuns] = useState<WorkflowRun[] | undefined>([]);\n const [searchTerm, setSearchTerm] = useState('');\n\n const handleSearch = (event: ChangeEvent<HTMLInputElement>) => {\n setSearchTerm(event.target.value);\n };\n\n const [\n { runs: runsData, branches, defaultBranch, ...cardProps },\n { retry, setPage, setPageSize },\n ] = useWorkflowRuns({\n hostname,\n owner,\n repo,\n branch: branch === 'all' ? undefined : branch,\n });\n\n const githubHost = hostname || 'github.com';\n const hasNoRuns = !cardProps.loading && !runsData;\n\n const handleMenuChange = (\n event: ChangeEvent<{ name?: string; value: unknown }>,\n ) => {\n const selectedValue = event.target.value as string;\n setBranch(selectedValue);\n setPage(0);\n retry();\n };\n\n useEffect(() => {\n setRuns(runsData);\n }, [runsData, branch]);\n\n useEffect(() => {\n setBranch(defaultBranch);\n }, [defaultBranch]);\n\n return (\n <Grid item>\n {hasNoRuns ? (\n <EmptyState\n missing=\"data\"\n title=\"No Workflow Data\"\n description=\"This component has GitHub Actions enabled, but no data was found. Have you created any Workflows? Click the button below to create a new Workflow.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href={`https://${githubHost}/${projectName}/actions/new`}\n >\n Create new Workflow\n </Button>\n }\n />\n ) : (\n <InfoCard\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <GitHubIcon />\n <Box mr={1} />\n <Typography variant=\"h6\">{projectName}</Typography>\n\n <Select\n value={branch}\n key={branch}\n label=\"Branch\"\n onChange={handleMenuChange}\n data-testid=\"menu-control\"\n style={{\n marginLeft: '30px',\n marginRight: '20px',\n width: '230px',\n }}\n >\n {branches.map(branchItem => (\n <MenuItem key={branchItem.name} value={branchItem.name}>\n {branchItem.name === defaultBranch ? (\n <Typography variant=\"body2\" component=\"span\">\n {branchItem.name}{' '}\n <Typography\n variant=\"body2\"\n component=\"span\"\n style={{ color: 'lightgray', fontSize: 'x-small' }}\n >\n (default)\n </Typography>\n </Typography>\n ) : (\n branchItem.name\n )}\n </MenuItem>\n ))}\n\n <MenuItem\n value=\"all\"\n key=\"all\"\n style={{ color: 'lightGrey', fontSize: 'small' }}\n >\n select all branches\n </MenuItem>\n </Select>\n\n <WorkflowRunsCardSearch\n searchTerm={searchTerm}\n handleSearch={handleSearch}\n retry={retry}\n />\n </Box>\n }\n >\n <WorkflowRunsCardView\n runs={runs}\n loading={cardProps.loading}\n onChangePageSize={setPageSize}\n onChangePage={setPage}\n page={cardProps.page}\n total={cardProps.total}\n pageSize={cardProps.pageSize}\n searchTerm={searchTerm}\n projectName={projectName}\n />\n </InfoCard>\n )}\n </Grid>\n );\n};\n\nexport default WorkflowRunsCard;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,OAAO,CAAA,CAAA;AAAA,MAC1C,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC1B,YAAc,EAAA,KAAA;AAAA,MACd,QAAU,EAAA,SAAA;AAAA,MACV,QAAU,EAAA,UAAA;AAAA,MACV,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,MAC7B,IAAM,EAAA,GAAA;AAA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