@anyshift/backstage-plugin-anyshift 0.1.0-beta.3 → 0.1.0-beta.5
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 +5 -0
- package/dist/index.d.ts +3 -3
- package/dist/package.json.esm.js +1 -1
- package/dist/plugin.esm.js +13 -5
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.5
|
|
4
|
+
|
|
5
|
+
- Hide entity content for catalog resources without a supported Anyshift brief kind.
|
|
6
|
+
- Preserve the default workload view for GitHub-owned Components.
|
|
7
|
+
|
|
3
8
|
## 0.1.0-beta.3
|
|
4
9
|
|
|
5
10
|
- Show durable catalog reconciliation status on the global dashboard.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import * as _backstage_filter_predicates from '@backstage/filter-predicates';
|
|
4
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { Entity } from '@backstage/catalog-model';
|
|
5
5
|
import { AnyshiftCapabilities, ServiceBrief, BriefSectionName, BriefSectionResponse, EstateInsights, DatadogSignals, CatalogSummary, QueryResult, CatalogSyncReport } from '@anyshift/backstage-plugin-anyshift-common';
|
|
6
6
|
export { ANYSHIFT_KIND_ANNOTATION, ANYSHIFT_OBSERVED_SERVICE_ANNOTATION, ANYSHIFT_RESOURCE_ID_ANNOTATION, ANYSHIFT_RESOURCE_TYPE_ANNOTATION, ANYSHIFT_TARGET_ANNOTATION, BriefSection, CatalogSummary, EstateInsights, GITHUB_PROJECT_SLUG_ANNOTATION, QueryResult, ServiceBrief, anyshiftQueryPermission, anyshiftViewPermission } from '@anyshift/backstage-plugin-anyshift-common';
|
|
7
7
|
|
|
@@ -36,7 +36,7 @@ declare const anyshiftPlugin: _backstage_frontend_plugin_api.OverridableFrontend
|
|
|
36
36
|
};
|
|
37
37
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
38
38
|
optional: true;
|
|
39
|
-
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity:
|
|
39
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {
|
|
40
40
|
optional: true;
|
|
41
41
|
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
42
42
|
optional: true;
|
|
@@ -56,7 +56,7 @@ declare const anyshiftPlugin: _backstage_frontend_plugin_api.OverridableFrontend
|
|
|
56
56
|
icon?: string | react.ReactElement;
|
|
57
57
|
loader: () => Promise<JSX.Element>;
|
|
58
58
|
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
59
|
-
filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity:
|
|
59
|
+
filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity: Entity) => boolean);
|
|
60
60
|
};
|
|
61
61
|
}>;
|
|
62
62
|
"page:anyshift": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
package/dist/package.json.esm.js
CHANGED
package/dist/plugin.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import DeviceHubIcon from '@material-ui/icons/DeviceHub';
|
|
3
3
|
import { ApiBlueprint, fetchApiRef, discoveryApiRef, PageBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
4
4
|
import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
5
|
-
import { anyshiftViewPermission, ANYSHIFT_TARGET_ANNOTATION, GITHUB_PROJECT_SLUG_ANNOTATION } from '@anyshift/backstage-plugin-anyshift-common';
|
|
5
|
+
import { anyshiftViewPermission, ANYSHIFT_TARGET_ANNOTATION, GITHUB_PROJECT_SLUG_ANNOTATION, ANYSHIFT_KIND_ANNOTATION, isAnyshiftResourceKind, ANYSHIFT_MANAGED_BY_ANNOTATION } from '@anyshift/backstage-plugin-anyshift-common';
|
|
6
6
|
import { AnyshiftPermissionBoundary } from './components/AnyshiftPermissionBoundary.esm.js';
|
|
7
7
|
import { AnyshiftClient, anyshiftApiRef } from './api/AnyshiftApi.esm.js';
|
|
8
8
|
import { rootRouteRef } from './routes.esm.js';
|
|
@@ -30,12 +30,20 @@ const anyshiftEntityContent = EntityContentBlueprint.make({
|
|
|
30
30
|
path: "/anyshift",
|
|
31
31
|
title: "Anyshift",
|
|
32
32
|
group: "observability",
|
|
33
|
-
filter:
|
|
34
|
-
entity.metadata.annotations?.[ANYSHIFT_TARGET_ANNOTATION] || entity.metadata.annotations?.[GITHUB_PROJECT_SLUG_ANNOTATION]
|
|
35
|
-
),
|
|
33
|
+
filter: isAnyshiftEntityContentAvailable,
|
|
36
34
|
loader: () => import('./components/entity/AnyshiftEntityContent.esm.js').then((module) => /* @__PURE__ */ jsx(AnyshiftPermissionBoundary, { permission: anyshiftViewPermission, children: /* @__PURE__ */ jsx(module.AnyshiftEntityContent, {}) }))
|
|
37
35
|
}
|
|
38
36
|
});
|
|
37
|
+
function isAnyshiftEntityContentAvailable(entity) {
|
|
38
|
+
const annotations = entity.metadata.annotations ?? {};
|
|
39
|
+
const hasTarget = Boolean(
|
|
40
|
+
annotations[ANYSHIFT_TARGET_ANNOTATION] || annotations[GITHUB_PROJECT_SLUG_ANNOTATION]
|
|
41
|
+
);
|
|
42
|
+
if (!hasTarget) return false;
|
|
43
|
+
const kind = annotations[ANYSHIFT_KIND_ANNOTATION];
|
|
44
|
+
if (kind) return isAnyshiftResourceKind(kind);
|
|
45
|
+
return annotations[ANYSHIFT_MANAGED_BY_ANNOTATION] !== "catalog-provider";
|
|
46
|
+
}
|
|
39
47
|
const anyshiftPlugin = createFrontendPlugin({
|
|
40
48
|
pluginId: "anyshift",
|
|
41
49
|
info: {
|
|
@@ -45,5 +53,5 @@ const anyshiftPlugin = createFrontendPlugin({
|
|
|
45
53
|
extensions: [anyshiftApi, anyshiftPage, anyshiftEntityContent]
|
|
46
54
|
});
|
|
47
55
|
|
|
48
|
-
export { anyshiftPlugin };
|
|
56
|
+
export { anyshiftPlugin, isAnyshiftEntityContentAvailable };
|
|
49
57
|
//# sourceMappingURL=plugin.esm.js.map
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.tsx"],"sourcesContent":["import DeviceHubIcon from '@material-ui/icons/DeviceHub';\nimport {\n ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ANYSHIFT_TARGET_ANNOTATION,\n GITHUB_PROJECT_SLUG_ANNOTATION,\n anyshiftViewPermission,\n} from '@anyshift/backstage-plugin-anyshift-common';\nimport { AnyshiftPermissionBoundary } from './components/AnyshiftPermissionBoundary';\nimport { anyshiftApiRef, AnyshiftClient } from './api/AnyshiftApi';\nimport { rootRouteRef } from './routes';\n\nconst anyshiftApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: anyshiftApiRef,\n deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },\n factory: ({ discoveryApi, fetchApi }) =>\n new AnyshiftClient({ discoveryApi, fetchApi }),\n }),\n});\n\nconst anyshiftPage = PageBlueprint.make({\n params: {\n path: '/anyshift',\n title: 'Anyshift',\n icon: <DeviceHubIcon fontSize=\"inherit\" />,\n routeRef: rootRouteRef,\n noHeader: true,\n loader: () =>\n import('./components/explorer/AnyshiftExplorerPage').then(module => (\n <AnyshiftPermissionBoundary permission={anyshiftViewPermission}>\n <module.AnyshiftExplorerPage />\n </AnyshiftPermissionBoundary>\n )),\n },\n});\n\nconst anyshiftEntityContent = EntityContentBlueprint.make({\n name: 'entity-content',\n params: {\n path: '/anyshift',\n title: 'Anyshift',\n group: 'observability',\n filter:
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.tsx"],"sourcesContent":["import DeviceHubIcon from '@material-ui/icons/DeviceHub';\nimport {\n ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport type { Entity } from '@backstage/catalog-model';\nimport {\n ANYSHIFT_KIND_ANNOTATION,\n ANYSHIFT_MANAGED_BY_ANNOTATION,\n ANYSHIFT_TARGET_ANNOTATION,\n GITHUB_PROJECT_SLUG_ANNOTATION,\n anyshiftViewPermission,\n isAnyshiftResourceKind,\n} from '@anyshift/backstage-plugin-anyshift-common';\nimport { AnyshiftPermissionBoundary } from './components/AnyshiftPermissionBoundary';\nimport { anyshiftApiRef, AnyshiftClient } from './api/AnyshiftApi';\nimport { rootRouteRef } from './routes';\n\nconst anyshiftApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: anyshiftApiRef,\n deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },\n factory: ({ discoveryApi, fetchApi }) =>\n new AnyshiftClient({ discoveryApi, fetchApi }),\n }),\n});\n\nconst anyshiftPage = PageBlueprint.make({\n params: {\n path: '/anyshift',\n title: 'Anyshift',\n icon: <DeviceHubIcon fontSize=\"inherit\" />,\n routeRef: rootRouteRef,\n noHeader: true,\n loader: () =>\n import('./components/explorer/AnyshiftExplorerPage').then(module => (\n <AnyshiftPermissionBoundary permission={anyshiftViewPermission}>\n <module.AnyshiftExplorerPage />\n </AnyshiftPermissionBoundary>\n )),\n },\n});\n\nconst anyshiftEntityContent = EntityContentBlueprint.make({\n name: 'entity-content',\n params: {\n path: '/anyshift',\n title: 'Anyshift',\n group: 'observability',\n filter: isAnyshiftEntityContentAvailable,\n loader: () =>\n import('./components/entity/AnyshiftEntityContent').then(module => (\n <AnyshiftPermissionBoundary permission={anyshiftViewPermission}>\n <module.AnyshiftEntityContent />\n </AnyshiftPermissionBoundary>\n )),\n },\n});\n\nexport function isAnyshiftEntityContentAvailable(entity: Entity): boolean {\n const annotations = entity.metadata.annotations ?? {};\n const hasTarget = Boolean(\n annotations[ANYSHIFT_TARGET_ANNOTATION] ||\n annotations[GITHUB_PROJECT_SLUG_ANNOTATION],\n );\n if (!hasTarget) return false;\n\n const kind = annotations[ANYSHIFT_KIND_ANNOTATION];\n if (kind) return isAnyshiftResourceKind(kind);\n\n return annotations[ANYSHIFT_MANAGED_BY_ANNOTATION] !== 'catalog-provider';\n}\n\nexport const anyshiftPlugin = createFrontendPlugin({\n pluginId: 'anyshift',\n info: {\n packageJson: () => import('../package.json'),\n },\n routes: { root: rootRouteRef },\n extensions: [anyshiftApi, anyshiftPage, anyshiftEntityContent],\n});\n\nexport default anyshiftPlugin;\n"],"names":[],"mappings":";;;;;;;;;AAsBA,MAAM,WAAA,GAAc,aAAa,IAAA,CAAK;AAAA,EACpC,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,cAAA;AAAA,IACL,IAAA,EAAM,EAAE,YAAA,EAAc,eAAA,EAAiB,UAAU,WAAA,EAAY;AAAA,IAC7D,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,QAAA,EAAS,KACjC,IAAI,cAAA,CAAe,EAAE,YAAA,EAAc,QAAA,EAAU;AAAA,GAChD;AACL,CAAC,CAAA;AAED,MAAM,YAAA,GAAe,cAAc,IAAA,CAAK;AAAA,EACtC,MAAA,EAAQ;AAAA,IACN,IAAA,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AAO,WAAA,CAAY,8BAA8B,CAAA,KAAM,kBAAA;AACzD;AAEO,MAAM,iBAAiB,oBAAA,CAAqB;AAAA,EACjD,QAAA,EAAU,UAAA;AAAA,EACV,IAAA,EAAM;AAAA,IACJ,WAAA,EAAa,MAAM,OAAO,uBAAiB;AAAA,GAC7C;AAAA,EACA,MAAA,EAAQ,EAAE,IAAA,EAAM,YAAA,EAAa;AAAA,EAC7B,UAAA,EAAY,CAAC,WAAA,EAAa,YAAA,EAAc,qBAAqB;AAC/D,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anyshift/backstage-plugin-anyshift",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.5",
|
|
4
4
|
"description": "Read-only Anyshift infrastructure context for Backstage",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"clean": "backstage-cli package clean"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@anyshift/backstage-plugin-anyshift-common": "^0.1.0-beta.
|
|
48
|
+
"@anyshift/backstage-plugin-anyshift-common": "^0.1.0-beta.5",
|
|
49
49
|
"@backstage/catalog-model": "^1.9.0",
|
|
50
50
|
"@backstage/core-components": "^0.18.11",
|
|
51
51
|
"@backstage/frontend-plugin-api": "^0.17.2",
|