@backstage-community/plugin-github-actions 0.9.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/alpha/entityCards.esm.js +5 -5
- package/dist/alpha/entityCards.esm.js.map +1 -1
- package/dist/alpha/entityContent.esm.js +2 -2
- package/dist/alpha/entityContent.esm.js.map +1 -1
- package/dist/alpha.d.ts +21 -21
- package/dist/components/Cards/Cards.esm.js +19 -10
- package/dist/components/Cards/Cards.esm.js.map +1 -1
- package/dist/components/Cards/RecentWorkflowRunsCard.esm.js +34 -30
- package/dist/components/Cards/RecentWorkflowRunsCard.esm.js.map +1 -1
- package/dist/components/Router.esm.js +13 -10
- package/dist/components/Router.esm.js.map +1 -1
- package/dist/components/WorkflowRunDetails/WorkflowRunDetails.esm.js +94 -36
- package/dist/components/WorkflowRunDetails/WorkflowRunDetails.esm.js.map +1 -1
- package/dist/components/WorkflowRunLogs/WorkflowRunLogs.esm.js +41 -35
- package/dist/components/WorkflowRunLogs/WorkflowRunLogs.esm.js.map +1 -1
- package/dist/components/WorkflowRunStatus/WorkflowRunStatus.esm.js +12 -9
- package/dist/components/WorkflowRunStatus/WorkflowRunStatus.esm.js.map +1 -1
- package/dist/components/WorkflowRunsCard/WorkflowRunsCard.esm.js +198 -165
- package/dist/components/WorkflowRunsCard/WorkflowRunsCard.esm.js.map +1 -1
- package/dist/components/WorkflowRunsTable/WorkflowRunsTable.esm.js +25 -18
- package/dist/components/WorkflowRunsTable/WorkflowRunsTable.esm.js.map +1 -1
- package/dist/index.d.ts +15 -18
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage-community/plugin-github-actions
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f1e2943: Backstage version bump to v1.39.0
|
|
8
|
+
|
|
9
|
+
## 0.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 5041897: Backstage version bump to v1.38.1
|
|
14
|
+
|
|
3
15
|
## 0.9.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
3
3
|
import { isGithubActionsAvailable } from '../components/Router.esm.js';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ const entityGithubActionsCard = EntityCardBlueprint.make({
|
|
|
6
6
|
name: "workflow-runs",
|
|
7
7
|
params: {
|
|
8
8
|
filter: isGithubActionsAvailable,
|
|
9
|
-
loader: () => import('../components/Router.esm.js').then((m) => /* @__PURE__ */
|
|
9
|
+
loader: () => import('../components/Router.esm.js').then((m) => /* @__PURE__ */ jsx(m.Router, { view: "cards" }))
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const entityLatestGithubActionRunCard = EntityCardBlueprint.makeWithOverrides({
|
|
@@ -21,7 +21,7 @@ const entityLatestGithubActionRunCard = EntityCardBlueprint.makeWithOverrides({
|
|
|
21
21
|
factory(originalFactory, { config }) {
|
|
22
22
|
return originalFactory({
|
|
23
23
|
filter: isGithubActionsAvailable,
|
|
24
|
-
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */
|
|
24
|
+
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.LatestWorkflowRunCard, { ...config.props }))
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -37,7 +37,7 @@ const entityLatestGithubActionsForBranchCard = EntityCardBlueprint.makeWithOverr
|
|
|
37
37
|
factory(originalFactory, { config }) {
|
|
38
38
|
return originalFactory({
|
|
39
39
|
filter: isGithubActionsAvailable,
|
|
40
|
-
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */
|
|
40
|
+
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.LatestWorkflowsForBranchCard, { ...config.props }))
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -55,7 +55,7 @@ const entityRecentGithubActionsRunsCard = EntityCardBlueprint.makeWithOverrides(
|
|
|
55
55
|
factory(originalFactory, { config }) {
|
|
56
56
|
return originalFactory({
|
|
57
57
|
filter: isGithubActionsAvailable,
|
|
58
|
-
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */
|
|
58
|
+
loader: async () => import('../components/Cards/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.RecentWorkflowRunsCard, { ...config.props }))
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.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
|
|
1
|
+
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.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 { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { isGithubActionsAvailable } from '../components/Router';\n\n/**\n * @alpha\n */\nexport const entityGithubActionsCard = EntityCardBlueprint.make({\n name: 'workflow-runs',\n params: {\n filter: isGithubActionsAvailable,\n loader: () =>\n import('../components/Router').then(m => <m.Router view=\"cards\" />),\n },\n});\n\n/**\n * @alpha\n */\nexport const entityLatestGithubActionRunCard =\n EntityCardBlueprint.makeWithOverrides({\n name: 'latest-workflow-run',\n config: {\n schema: {\n props: z =>\n z\n .object({\n branch: z.string().default('master'),\n })\n .default({}),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n filter: isGithubActionsAvailable,\n loader: async () =>\n import('../components/Cards').then(m => (\n <m.LatestWorkflowRunCard {...config.props} />\n )),\n });\n },\n });\n\n/**\n * @alpha\n */\nexport const entityLatestGithubActionsForBranchCard =\n EntityCardBlueprint.makeWithOverrides({\n name: 'latest-branch-workflow-runs',\n config: {\n schema: {\n props: z =>\n z\n .object({\n branch: z.string().default('master'),\n })\n .default({}),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n filter: isGithubActionsAvailable,\n loader: async () =>\n import('../components/Cards').then(m => (\n <m.LatestWorkflowsForBranchCard {...config.props} />\n )),\n });\n },\n });\n\n/**\n * @alpha\n */\nexport const entityRecentGithubActionsRunsCard =\n EntityCardBlueprint.makeWithOverrides({\n name: 'recent-workflow-runs',\n config: {\n schema: {\n props: z =>\n z\n .object({\n branch: z.string().default('master'),\n dense: z.boolean().default(false),\n limit: z.number().default(5).optional(),\n })\n .default({}),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n filter: isGithubActionsAvailable,\n loader: async () =>\n import('../components/Cards').then(m => (\n <m.RecentWorkflowRunsCard {...config.props} />\n )),\n });\n },\n });\n"],"names":[],"mappings":";;;;AAqBa,MAAA,uBAAA,GAA0B,oBAAoB,IAAK,CAAA;AAAA,EA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from '@backstage/plugin-catalog-react/alpha';
|
|
4
4
|
import { isGithubActionsAvailable } from '../components/Router.esm.js';
|
|
@@ -11,7 +11,7 @@ const entityGithubActionsContent = EntityContentBlueprint.make({
|
|
|
11
11
|
defaultTitle: "GitHub Actions",
|
|
12
12
|
filter: isGithubActionsAvailable,
|
|
13
13
|
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
14
|
-
loader: () => import('../components/Router.esm.js').then((m) => /* @__PURE__ */
|
|
14
|
+
loader: () => import('../components/Router.esm.js').then((m) => /* @__PURE__ */ jsx(m.Router, { view: "table" }))
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityContent.esm.js","sources":["../../src/alpha/entityContent.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
|
|
1
|
+
{"version":3,"file":"entityContent.esm.js","sources":["../../src/alpha/entityContent.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 { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { isGithubActionsAvailable } from '../components/Router';\nimport { rootRouteRef } from '../routes';\n\n/**\n * @alpha\n */\nexport const entityGithubActionsContent = EntityContentBlueprint.make({\n name: 'entity',\n params: {\n defaultPath: 'github-actions',\n defaultTitle: 'GitHub Actions',\n filter: isGithubActionsAvailable,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('../components/Router').then(m => <m.Router view=\"table\" />),\n },\n});\n"],"names":[],"mappings":";;;;;;AAuBa,MAAA,0BAAA,GAA6B,uBAAuB,IAAK,CAAA;AAAA,EACpE,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,gBAAA;AAAA,IACb,YAAc,EAAA,gBAAA;AAAA,IACd,MAAQ,EAAA,wBAAA;AAAA,IACR,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,6BAAsB,CAAE,CAAA,IAAA,CAAK,CAAK,CAAA,qBAAA,GAAA,CAAC,CAAE,CAAA,MAAA,EAAF,EAAS,IAAA,EAAK,SAAQ,CAAE;AAAA;AAExE,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
5
|
-
import * as
|
|
5
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
6
6
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -11,18 +11,18 @@ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api'
|
|
|
11
11
|
declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
12
12
|
entityContent: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
13
13
|
}, {}, {
|
|
14
|
-
|
|
14
|
+
[x: `api:${string}`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
15
15
|
kind: "api";
|
|
16
16
|
name: undefined;
|
|
17
17
|
config: {};
|
|
18
18
|
configInput: {};
|
|
19
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
19
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_core_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
20
20
|
inputs: {};
|
|
21
21
|
params: {
|
|
22
|
-
factory:
|
|
22
|
+
factory: _backstage_core_plugin_api.AnyApiFactory;
|
|
23
23
|
};
|
|
24
24
|
}>;
|
|
25
|
-
|
|
25
|
+
[x: `entity-card:${string}/latest-branch-workflow-runs`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
26
26
|
config: {
|
|
27
27
|
props: {
|
|
28
28
|
branch: string;
|
|
@@ -39,7 +39,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
39
39
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
40
40
|
type?: "content" | "summary" | "info" | undefined;
|
|
41
41
|
};
|
|
42
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity:
|
|
42
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
43
43
|
optional: true;
|
|
44
44
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
45
45
|
optional: true;
|
|
@@ -56,11 +56,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
56
56
|
name: "latest-branch-workflow-runs";
|
|
57
57
|
params: {
|
|
58
58
|
loader: () => Promise<JSX.Element>;
|
|
59
|
-
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
59
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
60
60
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
61
61
|
};
|
|
62
62
|
}>;
|
|
63
|
-
|
|
63
|
+
[x: `entity-card:${string}/latest-workflow-run`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
64
64
|
config: {
|
|
65
65
|
props: {
|
|
66
66
|
branch: string;
|
|
@@ -77,7 +77,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
77
77
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
78
78
|
type?: "content" | "summary" | "info" | undefined;
|
|
79
79
|
};
|
|
80
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity:
|
|
80
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
81
81
|
optional: true;
|
|
82
82
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
83
83
|
optional: true;
|
|
@@ -94,11 +94,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
94
94
|
name: "latest-workflow-run";
|
|
95
95
|
params: {
|
|
96
96
|
loader: () => Promise<JSX.Element>;
|
|
97
|
-
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
97
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
98
98
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
99
99
|
};
|
|
100
100
|
}>;
|
|
101
|
-
|
|
101
|
+
[x: `entity-card:${string}/recent-workflow-runs`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
102
102
|
config: {
|
|
103
103
|
props: {
|
|
104
104
|
dense: boolean;
|
|
@@ -119,7 +119,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
119
119
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
120
120
|
type?: "content" | "summary" | "info" | undefined;
|
|
121
121
|
};
|
|
122
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity:
|
|
122
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
123
123
|
optional: true;
|
|
124
124
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
125
125
|
optional: true;
|
|
@@ -136,11 +136,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
136
136
|
name: "recent-workflow-runs";
|
|
137
137
|
params: {
|
|
138
138
|
loader: () => Promise<JSX.Element>;
|
|
139
|
-
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
139
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
140
140
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
141
141
|
};
|
|
142
142
|
}>;
|
|
143
|
-
|
|
143
|
+
[x: `entity-card:${string}/workflow-runs`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
144
144
|
kind: "entity-card";
|
|
145
145
|
name: "workflow-runs";
|
|
146
146
|
config: {
|
|
@@ -151,7 +151,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
151
151
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
152
152
|
type?: "content" | "summary" | "info" | undefined;
|
|
153
153
|
};
|
|
154
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity:
|
|
154
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
155
155
|
optional: true;
|
|
156
156
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
157
157
|
optional: true;
|
|
@@ -161,11 +161,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
161
161
|
inputs: {};
|
|
162
162
|
params: {
|
|
163
163
|
loader: () => Promise<JSX.Element>;
|
|
164
|
-
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
164
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
165
165
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
166
166
|
};
|
|
167
167
|
}>;
|
|
168
|
-
|
|
168
|
+
[x: `entity-content:${string}/entity`]: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
169
169
|
kind: "entity-content";
|
|
170
170
|
name: "entity";
|
|
171
171
|
config: {
|
|
@@ -182,7 +182,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
182
182
|
};
|
|
183
183
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
184
184
|
optional: true;
|
|
185
|
-
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity:
|
|
185
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
186
186
|
optional: true;
|
|
187
187
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
188
188
|
optional: true;
|
|
@@ -194,9 +194,9 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
194
194
|
loader: () => Promise<JSX.Element>;
|
|
195
195
|
defaultPath: string;
|
|
196
196
|
defaultTitle: string;
|
|
197
|
-
defaultGroup?: (string & {}) | "development" | "deployment" | "documentation" | "observability" | undefined;
|
|
197
|
+
defaultGroup?: (string & {}) | "development" | "deployment" | "overview" | "documentation" | "operation" | "observability" | undefined;
|
|
198
198
|
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
199
|
-
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity:
|
|
199
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
200
200
|
};
|
|
201
201
|
}>;
|
|
202
202
|
}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
2
3
|
import LinearProgress from '@material-ui/core/LinearProgress';
|
|
3
4
|
import Typography from '@material-ui/core/Typography';
|
|
4
5
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
6
|
import ExternalLinkIcon from '@material-ui/icons/Launch';
|
|
6
|
-
import
|
|
7
|
+
import { useEffect } from 'react';
|
|
7
8
|
import { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity.esm.js';
|
|
8
9
|
import { useWorkflowRuns } from '../useWorkflowRuns.esm.js';
|
|
9
10
|
import { WorkflowRunsTable } from '../WorkflowRunsTable/WorkflowRunsTable.esm.js';
|
|
@@ -22,21 +23,29 @@ const useStyles = makeStyles({
|
|
|
22
23
|
const WidgetContent = (props) => {
|
|
23
24
|
const { error, loading, lastRun, branch } = props;
|
|
24
25
|
const classes = useStyles();
|
|
25
|
-
if (error) return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (error) return /* @__PURE__ */ jsxs(Typography, { children: [
|
|
27
|
+
"Couldn't fetch latest ",
|
|
28
|
+
branch,
|
|
29
|
+
" run"
|
|
30
|
+
] });
|
|
31
|
+
if (loading) return /* @__PURE__ */ jsx(LinearProgress, {});
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
28
33
|
StructuredMetadataTable,
|
|
29
34
|
{
|
|
30
35
|
metadata: {
|
|
31
|
-
status: /* @__PURE__ */
|
|
36
|
+
status: /* @__PURE__ */ jsx(Box, { display: "flex", children: /* @__PURE__ */ jsx(
|
|
32
37
|
WorkflowRunStatus,
|
|
33
38
|
{
|
|
34
39
|
status: lastRun.status,
|
|
35
40
|
conclusion: lastRun.conclusion
|
|
36
41
|
}
|
|
37
|
-
)),
|
|
42
|
+
) }),
|
|
38
43
|
message: lastRun.message,
|
|
39
|
-
url: /* @__PURE__ */
|
|
44
|
+
url: /* @__PURE__ */ jsxs(Link, { to: lastRun.githubUrl ?? "", children: [
|
|
45
|
+
"See more on GitHub",
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, { className: classes.externalLinkIcon })
|
|
48
|
+
] })
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
);
|
|
@@ -59,7 +68,7 @@ const LatestWorkflowRunCard = (props) => {
|
|
|
59
68
|
errorApi.post(error);
|
|
60
69
|
}
|
|
61
70
|
}, [error, errorApi]);
|
|
62
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: `Last ${branch} build`, variant, children: /* @__PURE__ */ jsx(
|
|
63
72
|
WidgetContent,
|
|
64
73
|
{
|
|
65
74
|
error,
|
|
@@ -67,12 +76,12 @@ const LatestWorkflowRunCard = (props) => {
|
|
|
67
76
|
branch,
|
|
68
77
|
lastRun
|
|
69
78
|
}
|
|
70
|
-
));
|
|
79
|
+
) });
|
|
71
80
|
};
|
|
72
81
|
const LatestWorkflowsForBranchCard = (props) => {
|
|
73
82
|
const { branch = "master", variant } = props;
|
|
74
83
|
const { entity } = useEntity();
|
|
75
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: `Last ${branch} build`, variant, children: /* @__PURE__ */ jsx(WorkflowRunsTable, { branch, entity }) });
|
|
76
85
|
};
|
|
77
86
|
|
|
78
87
|
export { LatestWorkflowRunCard, LatestWorkflowsForBranchCard };
|
|
@@ -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
|
|
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 { 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,a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AgB,CACrD,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
2
|
-
import
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import { Link as Link$1 } from 'react-router-dom';
|
|
4
5
|
import { GITHUB_ACTIONS_ANNOTATION } from '../getProjectNameFromEntity.esm.js';
|
|
5
6
|
import { useWorkflowRuns } from '../useWorkflowRuns.esm.js';
|
|
@@ -33,42 +34,45 @@ const RecentWorkflowRunsCard = (props) => {
|
|
|
33
34
|
const githubHost = hostname || "github.com";
|
|
34
35
|
const routeLink = useRouteRef(buildRouteRef);
|
|
35
36
|
if (error) {
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { title: error.message, error });
|
|
37
38
|
}
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
39
40
|
InfoCard,
|
|
40
41
|
{
|
|
41
42
|
title: "Recent Workflow Runs",
|
|
42
43
|
subheader: branch ? `Branch: ${branch}` : "All Branches",
|
|
43
44
|
noPadding: true,
|
|
44
|
-
variant
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
title: "Commit Message",
|
|
59
|
-
field: "message",
|
|
60
|
-
render: (data) => /* @__PURE__ */ React.createElement(Link, { component: Link$1, to: routeLink({ id: data.id }) }, firstLine(data.message ?? ""))
|
|
45
|
+
variant,
|
|
46
|
+
children: !runs.length ? /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: "This component has GitHub Actions enabled, but no workflows were found." }),
|
|
48
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: /* @__PURE__ */ jsx(Link, { to: `https://${githubHost}/${owner}/${repo}/actions/new`, children: "Create a new workflow" }) })
|
|
49
|
+
] }) : /* @__PURE__ */ jsx(
|
|
50
|
+
Table,
|
|
51
|
+
{
|
|
52
|
+
isLoading: loading,
|
|
53
|
+
options: {
|
|
54
|
+
search: false,
|
|
55
|
+
paging: false,
|
|
56
|
+
padding: dense ? "dense" : "default",
|
|
57
|
+
toolbar: false
|
|
61
58
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
columns: [
|
|
60
|
+
{
|
|
61
|
+
title: "Commit Message",
|
|
62
|
+
field: "message",
|
|
63
|
+
render: (data) => /* @__PURE__ */ jsx(Link, { component: Link$1, to: routeLink({ id: data.id }), children: firstLine(data.message ?? "") })
|
|
64
|
+
},
|
|
65
|
+
{ title: "Branch", field: "source.branchName" },
|
|
66
|
+
{
|
|
67
|
+
title: "Status",
|
|
68
|
+
field: "status",
|
|
69
|
+
render: (p) => /* @__PURE__ */ jsx(Box, { display: "flex", children: /* @__PURE__ */ jsx(WorkflowRunStatus, { ...p }) })
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
data: runs
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
72
76
|
);
|
|
73
77
|
};
|
|
74
78
|
|
|
@@ -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
|
|
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 { 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;AAGvD,MAAA,sBAAA,GAAyB,CAAC,KAKjC,KAAA;AACJ,EAAA,MAAM,EAAE,MAAQ,EAAA,KAAA,GAAQ,OAAO,KAAQ,GAAA,CAAA,EAAG,SAAY,GAAA,KAAA;AAEtD,EAAM,MAAA,EAAE,MAAO,EAA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J;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
|
|
3
3
|
import { Routes, Route } from 'react-router-dom';
|
|
4
4
|
import { buildRouteRef } from '../routes.esm.js';
|
|
@@ -12,16 +12,19 @@ const Router = (props) => {
|
|
|
12
12
|
const { view = "table" } = props;
|
|
13
13
|
const { entity } = useEntity();
|
|
14
14
|
if (!isGithubActionsAvailable(entity)) {
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(MissingAnnotationEmptyState, { annotation: GITHUB_ACTIONS_ANNOTATION });
|
|
16
16
|
}
|
|
17
|
-
const workflowRunsComponent = view === "cards" ? /* @__PURE__ */
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
Route,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
const workflowRunsComponent = view === "cards" ? /* @__PURE__ */ jsx(WorkflowRunsCard, { entity }) : /* @__PURE__ */ jsx(WorkflowRunsTable, { entity });
|
|
18
|
+
return /* @__PURE__ */ jsxs(Routes, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Route, { path: "/", element: workflowRunsComponent }),
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
Route,
|
|
22
|
+
{
|
|
23
|
+
path: `${buildRouteRef.path}`,
|
|
24
|
+
element: /* @__PURE__ */ jsx(WorkflowRunDetails, { entity })
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] });
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
export { Router, isGithubActionsAvailable };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.esm.js","sources":["../../src/components/Router.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
|
|
1
|
+
{"version":3,"file":"Router.esm.js","sources":["../../src/components/Router.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 { Entity } from '@backstage/catalog-model';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { Routes, Route } from 'react-router-dom';\nimport { buildRouteRef } from '../routes';\nimport { WorkflowRunDetails } from './WorkflowRunDetails';\nimport { WorkflowRunsCard } from './WorkflowRunsCard';\nimport { WorkflowRunsTable } from './WorkflowRunsTable';\nimport { GITHUB_ACTIONS_ANNOTATION } from './getProjectNameFromEntity';\nimport { RouterProps } from '../api/types';\n\n/** @public */\nexport const isGithubActionsAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]);\n\n/** @public */\nexport const Router = (props: RouterProps) => {\n const { view = 'table' } = props;\n const { entity } = useEntity();\n\n if (!isGithubActionsAvailable(entity)) {\n return (\n <MissingAnnotationEmptyState annotation={GITHUB_ACTIONS_ANNOTATION} />\n );\n }\n\n const workflowRunsComponent =\n view === 'cards' ? (\n <WorkflowRunsCard entity={entity} />\n ) : (\n <WorkflowRunsTable entity={entity} />\n );\n\n return (\n <Routes>\n <Route path=\"/\" element={workflowRunsComponent} />\n <Route\n path={`${buildRouteRef.path}`}\n element={<WorkflowRunDetails entity={entity} />}\n />\n </Routes>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8Ba,MAAA,wBAAA,GAA2B,CAAC,MACvC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,yBAAyB,CAAC;AAGrD,MAAA,MAAA,GAAS,CAAC,KAAuB,KAAA;AAC5C,EAAM,MAAA,EAAE,IAAO,GAAA,OAAA,EAAY,GAAA,KAAA;AAC3B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAI,IAAA,CAAC,wBAAyB,CAAA,MAAM,CAAG,EAAA;AACrC,IACE,uBAAA,GAAA,CAAC,2BAA4B,EAAA,EAAA,UAAA,EAAY,yBAA2B,EAAA,CAAA;AAAA;AAIxE,EAAM,MAAA,qBAAA,GACJ,SAAS,OACP,mBAAA,GAAA,CAAC,oBAAiB,MAAgB,EAAA,CAAA,mBAEjC,GAAA,CAAA,iBAAA,EAAA,EAAkB,MAAgB,EAAA,CAAA;AAGvC,EAAA,4BACG,MACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,KAAM,EAAA,EAAA,IAAA,EAAK,GAAI,EAAA,OAAA,EAAS,qBAAuB,EAAA,CAAA;AAAA,oBAChD,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,CAAG,EAAA,aAAA,CAAc,IAAI,CAAA,CAAA;AAAA,QAC3B,OAAA,kBAAU,GAAA,CAAA,kBAAA,EAAA,EAAmB,MAAgB,EAAA;AAAA;AAAA;AAC/C,GACF,EAAA,CAAA;AAEJ;;;;"}
|