@backstage/plugin-catalog 1.13.0 → 1.14.0-next.1
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 +62 -0
- package/alpha/package.json +7 -0
- package/dist/alpha.d.ts +14 -0
- package/dist/alpha.esm.js +45 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/esm/DefaultStarredEntitiesApi-cc4feb80.esm.js +79 -0
- package/dist/esm/DefaultStarredEntitiesApi-cc4feb80.esm.js.map +1 -0
- package/dist/esm/{index-5862e259.esm.js → index-2f599706.esm.js} +3 -2
- package/dist/esm/index-2f599706.esm.js.map +1 -0
- package/dist/esm/{index-ccf06d4f.esm.js → index-3524e4e8.esm.js} +2 -2
- package/dist/esm/{index-ccf06d4f.esm.js.map → index-3524e4e8.esm.js.map} +1 -1
- package/dist/esm/{index-087ed2ed.esm.js → index-877315c2.esm.js} +3 -2
- package/dist/esm/{index-087ed2ed.esm.js.map → index-877315c2.esm.js.map} +1 -1
- package/dist/esm/{index-4e218504.esm.js → index-a9833792.esm.js} +14 -7
- package/dist/esm/index-a9833792.esm.js.map +1 -0
- package/dist/esm/{index-7c223531.esm.js → index-b8cad66a.esm.js} +3 -2
- package/dist/esm/index-b8cad66a.esm.js.map +1 -0
- package/dist/esm/{index-ac94c8a1.esm.js → index-ba8d718c.esm.js} +10 -89
- package/dist/esm/index-ba8d718c.esm.js.map +1 -0
- package/dist/index.d.ts +1 -6
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +30 -17
- package/dist/esm/index-4e218504.esm.js.map +0 -1
- package/dist/esm/index-5862e259.esm.js.map +0 -1
- package/dist/esm/index-7c223531.esm.js.map +0 -1
- package/dist/esm/index-ac94c8a1.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.14.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7c4a8e4d5f: Create an experimental `CatalogSearchResultItemExtension` for declarative integration with Backstage; it can be accessed via the `/alpha` import.
|
|
8
|
+
- e5a2956dd2: Migrate catalog api to declarative integration system, it is exported from `/alpha` subpath.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/frontend-plugin-api@0.1.1-next.1
|
|
11
|
+
- @backstage/core-components@0.13.6-next.1
|
|
12
|
+
- @backstage/plugin-search-react@1.7.1-next.1
|
|
13
|
+
- @backstage/integration-react@1.1.20-next.1
|
|
14
|
+
- @backstage/plugin-catalog-react@1.8.5-next.1
|
|
15
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
16
|
+
- @backstage/catalog-client@1.4.4
|
|
17
|
+
- @backstage/catalog-model@1.4.2
|
|
18
|
+
- @backstage/errors@1.2.2
|
|
19
|
+
- @backstage/theme@0.4.2
|
|
20
|
+
- @backstage/types@1.1.1
|
|
21
|
+
- @backstage/plugin-catalog-common@1.0.16
|
|
22
|
+
- @backstage/plugin-scaffolder-common@1.4.1
|
|
23
|
+
- @backstage/plugin-search-common@1.2.6
|
|
24
|
+
|
|
25
|
+
## 1.14.0-next.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- 28f1ab2e1a: The catalog plugin no longer implements the experimental reconfiguration API. The create button title can now instead be configured using the new experimental internationalization API, via the `catalogTranslationRef` exported at `/alpha`. For example:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';
|
|
33
|
+
|
|
34
|
+
const app = createApp({
|
|
35
|
+
__experimentalTranslations: {
|
|
36
|
+
resources: [
|
|
37
|
+
createTranslationMessages({
|
|
38
|
+
ref: catalogTranslationRef,
|
|
39
|
+
catalog_page_create_button_title: 'Create Software',
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- f3561a2935: include owner chip in catalog search result item
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies
|
|
51
|
+
- @backstage/plugin-catalog-react@1.8.5-next.0
|
|
52
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
53
|
+
- @backstage/core-components@0.13.6-next.0
|
|
54
|
+
- @backstage/integration-react@1.1.20-next.0
|
|
55
|
+
- @backstage/plugin-search-react@1.7.1-next.0
|
|
56
|
+
- @backstage/catalog-client@1.4.4
|
|
57
|
+
- @backstage/catalog-model@1.4.2
|
|
58
|
+
- @backstage/errors@1.2.2
|
|
59
|
+
- @backstage/theme@0.4.2
|
|
60
|
+
- @backstage/types@1.1.1
|
|
61
|
+
- @backstage/plugin-catalog-common@1.0.16
|
|
62
|
+
- @backstage/plugin-scaffolder-common@1.4.1
|
|
63
|
+
- @backstage/plugin-search-common@1.2.6
|
|
64
|
+
|
|
3
65
|
## 1.13.0
|
|
4
66
|
|
|
5
67
|
### Minor Changes
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/** @alpha */
|
|
4
|
+
declare const CatalogApi: _backstage_frontend_plugin_api.Extension<{}>;
|
|
5
|
+
/** @alpha */
|
|
6
|
+
declare const StarredEntitiesApi: _backstage_frontend_plugin_api.Extension<{}>;
|
|
7
|
+
/** @alpha */
|
|
8
|
+
declare const CatalogSearchResultListItemExtension: _backstage_frontend_plugin_api.Extension<{
|
|
9
|
+
noTrack?: boolean | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
/** @alpha */
|
|
12
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin;
|
|
13
|
+
|
|
14
|
+
export { CatalogApi, CatalogSearchResultListItemExtension, StarredEntitiesApi, _default as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createApiFactory, discoveryApiRef, fetchApiRef, storageApiRef } from '@backstage/core-plugin-api';
|
|
2
|
+
import { CatalogClient } from '@backstage/catalog-client';
|
|
3
|
+
import { createApiExtension, createPlugin } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { catalogApiRef, starredEntitiesApiRef } from '@backstage/plugin-catalog-react';
|
|
5
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';
|
|
6
|
+
import { D as DefaultStarredEntitiesApi } from './esm/DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
7
|
+
import 'zen-observable';
|
|
8
|
+
import '@backstage/catalog-model';
|
|
9
|
+
import 'lodash';
|
|
10
|
+
|
|
11
|
+
const CatalogApi = createApiExtension({
|
|
12
|
+
factory: createApiFactory({
|
|
13
|
+
api: catalogApiRef,
|
|
14
|
+
deps: {
|
|
15
|
+
discoveryApi: discoveryApiRef,
|
|
16
|
+
fetchApi: fetchApiRef
|
|
17
|
+
},
|
|
18
|
+
factory: ({ discoveryApi, fetchApi }) => new CatalogClient({ discoveryApi, fetchApi })
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
const StarredEntitiesApi = createApiExtension({
|
|
22
|
+
factory: createApiFactory({
|
|
23
|
+
api: starredEntitiesApiRef,
|
|
24
|
+
deps: { storageApi: storageApiRef },
|
|
25
|
+
factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi })
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
const CatalogSearchResultListItemExtension = createSearchResultListItemExtension({
|
|
29
|
+
id: "catalog",
|
|
30
|
+
predicate: (result) => result.type === "software-catalog",
|
|
31
|
+
component: () => import('./esm/index-3524e4e8.esm.js').then(
|
|
32
|
+
(m) => m.CatalogSearchResultListItem
|
|
33
|
+
)
|
|
34
|
+
});
|
|
35
|
+
var alpha = createPlugin({
|
|
36
|
+
id: "catalog",
|
|
37
|
+
extensions: [
|
|
38
|
+
CatalogApi,
|
|
39
|
+
StarredEntitiesApi,
|
|
40
|
+
CatalogSearchResultListItemExtension
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { CatalogApi, CatalogSearchResultListItemExtension, StarredEntitiesApi, alpha as default };
|
|
45
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport {\n createApiExtension,\n createPlugin,\n} from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';\nimport { DefaultStarredEntitiesApi } from './apis';\n\n/** @alpha */\nexport const CatalogApi = createApiExtension({\n factory: createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n});\n\n/** @alpha */\nexport const StarredEntitiesApi = createApiExtension({\n factory: createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi }),\n }),\n});\n\n/** @alpha */\nexport const CatalogSearchResultListItemExtension =\n createSearchResultListItemExtension({\n id: 'catalog',\n predicate: result => result.type === 'software-catalog',\n component: () =>\n import('./components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n });\n\n/** @alpha */\nexport default createPlugin({\n id: 'catalog',\n extensions: [\n CatalogApi,\n StarredEntitiesApi,\n CatalogSearchResultListItemExtension,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;AAmCO,MAAM,aAAa,kBAAmB,CAAA;AAAA,EAC3C,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EAAA,aAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,eAAA;AAAA,MACd,QAAU,EAAA,WAAA;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,GAC/C,CAAA;AACH,CAAC,EAAA;AAGM,MAAM,qBAAqB,kBAAmB,CAAA;AAAA,EACnD,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EAAA,qBAAA;AAAA,IACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,IAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OAAiB,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY,CAAA;AAAA,GAC1E,CAAA;AACH,CAAC,EAAA;AAGM,MAAM,uCACX,mCAAoC,CAAA;AAAA,EAClC,EAAI,EAAA,SAAA;AAAA,EACJ,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,kBAAA;AAAA,EACrC,SAAW,EAAA,MACT,OAAO,6BAA0C,CAAE,CAAA,IAAA;AAAA,IACjD,OAAK,CAAE,CAAA,2BAAA;AAAA,GACT;AACJ,CAAC,EAAA;AAGH,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,SAAA;AAAA,EACJ,UAAY,EAAA;AAAA,IACV,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,oCAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import ObservableImpl from 'zen-observable';
|
|
2
|
+
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
|
+
import { isArray, isString } from 'lodash';
|
|
4
|
+
|
|
5
|
+
async function performMigrationToTheNewBucket({
|
|
6
|
+
storageApi
|
|
7
|
+
}) {
|
|
8
|
+
var _a;
|
|
9
|
+
const source = storageApi.forBucket("settings");
|
|
10
|
+
const target = storageApi.forBucket("starredEntities");
|
|
11
|
+
const oldStarredEntities = source.snapshot("starredEntities").value;
|
|
12
|
+
if (!isArray(oldStarredEntities)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const targetEntities = new Set(
|
|
16
|
+
(_a = target.snapshot("entityRefs").value) != null ? _a : []
|
|
17
|
+
);
|
|
18
|
+
oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(
|
|
19
|
+
([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })
|
|
20
|
+
).forEach((e) => targetEntities.add(e));
|
|
21
|
+
await target.set("entityRefs", Array.from(targetEntities));
|
|
22
|
+
await source.remove("starredEntities");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var __defProp = Object.defineProperty;
|
|
26
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
27
|
+
var __publicField = (obj, key, value) => {
|
|
28
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
class DefaultStarredEntitiesApi {
|
|
32
|
+
constructor(opts) {
|
|
33
|
+
__publicField(this, "settingsStore");
|
|
34
|
+
__publicField(this, "starredEntities");
|
|
35
|
+
__publicField(this, "subscribers", /* @__PURE__ */ new Set());
|
|
36
|
+
__publicField(this, "observable", new ObservableImpl((subscriber) => {
|
|
37
|
+
subscriber.next(new Set(this.starredEntities));
|
|
38
|
+
this.subscribers.add(subscriber);
|
|
39
|
+
return () => {
|
|
40
|
+
this.subscribers.delete(subscriber);
|
|
41
|
+
};
|
|
42
|
+
}));
|
|
43
|
+
var _a;
|
|
44
|
+
performMigrationToTheNewBucket(opts).then();
|
|
45
|
+
this.settingsStore = opts.storageApi.forBucket("starredEntities");
|
|
46
|
+
this.starredEntities = new Set(
|
|
47
|
+
(_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []
|
|
48
|
+
);
|
|
49
|
+
this.settingsStore.observe$("entityRefs").subscribe({
|
|
50
|
+
next: (next) => {
|
|
51
|
+
var _a2;
|
|
52
|
+
this.starredEntities = new Set((_a2 = next.value) != null ? _a2 : []);
|
|
53
|
+
this.notifyChanges();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async toggleStarred(entityRef) {
|
|
58
|
+
if (this.starredEntities.has(entityRef)) {
|
|
59
|
+
this.starredEntities.delete(entityRef);
|
|
60
|
+
} else {
|
|
61
|
+
this.starredEntities.add(entityRef);
|
|
62
|
+
}
|
|
63
|
+
await this.settingsStore.set(
|
|
64
|
+
"entityRefs",
|
|
65
|
+
Array.from(this.starredEntities)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
starredEntitie$() {
|
|
69
|
+
return this.observable;
|
|
70
|
+
}
|
|
71
|
+
notifyChanges() {
|
|
72
|
+
for (const subscription of this.subscribers) {
|
|
73
|
+
subscription.next(new Set(this.starredEntities));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { DefaultStarredEntitiesApi as D };
|
|
79
|
+
//# sourceMappingURL=DefaultStarredEntitiesApi-cc4feb80.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultStarredEntitiesApi-cc4feb80.esm.js","sources":["../../src/apis/StarredEntitiesApi/migration.ts","../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { stringifyEntityRef } from '@backstage/catalog-model';\nimport { StorageApi } from '@backstage/core-plugin-api';\nimport { isArray, isString } from 'lodash';\n\n/**\n * Migrate the starred entities from the old format (entity:<kind>:<namespace>:<name>) from the\n * old storage location (/settings/starredEntities) to entity references in the new location\n * (/starredEntities/entityRefs).\n *\n * This will only be executed once since the old location is cleared.\n *\n * @param storageApi - the StorageApi to migrate\n */\nexport async function performMigrationToTheNewBucket({\n storageApi,\n}: {\n storageApi: StorageApi;\n}) {\n const source = storageApi.forBucket('settings');\n const target = storageApi.forBucket('starredEntities');\n\n const oldStarredEntities = source.snapshot('starredEntities').value;\n\n if (!isArray(oldStarredEntities)) {\n // nothing to do\n return;\n }\n const targetEntities = new Set(\n target.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n oldStarredEntities\n .filter(isString)\n // extract the old format 'entity:<kind>:<namespace>:<name>'\n .map(old => old.split(':'))\n // check if the format is valid\n .filter(split => split.length === 4 && split[0] === 'entity')\n // convert to entity references\n .map(([_, kind, namespace, name]) =>\n stringifyEntityRef({ kind, namespace, name }),\n )\n .forEach(e => targetEntities.add(e));\n\n await target.set('entityRefs', Array.from(targetEntities));\n\n await source.remove('starredEntities');\n}\n","/*\n * Copyright 2021 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 { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the the latest value\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n private notifyChanges() {\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n}\n"],"names":["_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QAAA,IAAA,CAAK,aAAc,EAAA,CAAA;AAAA,OACrB;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AAAA,EAEA,MAAM,cAAc,SAAkC,EAAA;AACpD,IAAA,IAAI,IAAK,CAAA,eAAA,CAAgB,GAAI,CAAA,SAAS,CAAG,EAAA;AACvC,MAAK,IAAA,CAAA,eAAA,CAAgB,OAAO,SAAS,CAAA,CAAA;AAAA,KAChC,MAAA;AACL,MAAK,IAAA,CAAA,eAAA,CAAgB,IAAI,SAAS,CAAA,CAAA;AAAA,KACpC;AAEA,IAAA,MAAM,KAAK,aAAc,CAAA,GAAA;AAAA,MACvB,YAAA;AAAA,MACA,KAAA,CAAM,IAAK,CAAA,IAAA,CAAK,eAAe,CAAA;AAAA,KACjC,CAAA;AAAA,GACF;AAAA,EAEA,eAA2C,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GACd;AAAA,EAgBQ,aAAgB,GAAA;AACtB,IAAW,KAAA,MAAA,YAAA,IAAgB,KAAK,WAAa,EAAA;AAC3C,MAAA,YAAA,CAAa,IAAK,CAAA,IAAI,GAAI,CAAA,IAAA,CAAK,eAAe,CAAC,CAAA,CAAA;AAAA,KACjD;AAAA,GACF;AACF;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { E as EntityLabelsCard, h as hasLabels } from './index-
|
|
1
|
+
export { E as EntityLabelsCard, h as hasLabels } from './index-ba8d718c.esm.js';
|
|
2
|
+
import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
2
3
|
import 'zen-observable';
|
|
3
4
|
import '@backstage/catalog-model';
|
|
4
5
|
import 'lodash';
|
|
@@ -31,4 +32,4 @@ import '@material-ui/icons/Cancel';
|
|
|
31
32
|
import '@backstage/errors';
|
|
32
33
|
import '@backstage/catalog-client';
|
|
33
34
|
import '@backstage/plugin-search-react';
|
|
34
|
-
//# sourceMappingURL=index-
|
|
35
|
+
//# sourceMappingURL=index-2f599706.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-2f599706.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -47,8 +47,8 @@ function CatalogSearchResultListItem(props) {
|
|
|
47
47
|
}
|
|
48
48
|
) : result.text
|
|
49
49
|
}
|
|
50
|
-
), /* @__PURE__ */ React.createElement(Box, null, result.kind && /* @__PURE__ */ React.createElement(Chip, { label: `Kind: ${result.kind}`, size: "small" }), result.lifecycle && /* @__PURE__ */ React.createElement(Chip, { label: `Lifecycle: ${result.lifecycle}`, size: "small" }))));
|
|
50
|
+
), /* @__PURE__ */ React.createElement(Box, null, result.kind && /* @__PURE__ */ React.createElement(Chip, { label: `Kind: ${result.kind}`, size: "small" }), result.lifecycle && /* @__PURE__ */ React.createElement(Chip, { label: `Lifecycle: ${result.lifecycle}`, size: "small" }), result.owner && /* @__PURE__ */ React.createElement(Chip, { label: `Owner: ${result.owner}`, size: "small" }))));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export { CatalogSearchResultListItem };
|
|
54
|
-
//# sourceMappingURL=index-
|
|
54
|
+
//# sourceMappingURL=index-3524e4e8.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-3524e4e8.esm.js","sources":["../../src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, { ReactNode } from 'react';\nimport {\n Box,\n Chip,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(\n {\n item: {\n display: 'flex',\n },\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'CatalogSearchResultListItem' },\n);\n\n/**\n * Props for {@link CatalogSearchResultListItem}.\n *\n * @public\n */\nexport interface CatalogSearchResultListItemProps {\n icon?: ReactNode | ((result: IndexableDocument) => ReactNode);\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\n/** @public */\nexport function CatalogSearchResultListItem(\n props: CatalogSearchResultListItemProps,\n) {\n const result = props.result as any;\n const highlight = props.highlight as ResultHighlight;\n\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <div className={classes.item}>\n {props.icon && (\n <ListItemIcon>\n {typeof props.icon === 'function' ? props.icon(result) : props.icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )\n }\n />\n <Box>\n {result.kind && <Chip label={`Kind: ${result.kind}`} size=\"small\" />}\n {result.lifecycle && (\n <Chip label={`Lifecycle: ${result.lifecycle}`} size=\"small\" />\n )}\n {result.owner && (\n <Chip label={`Owner: ${result.owner}`} size=\"small\" />\n )}\n </Box>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
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { makeStyles, Typography, Button } from '@material-ui/core';
|
|
5
5
|
import { CodeSnippet, InfoCard } from '@backstage/core-components';
|
|
6
|
-
import { L as LinksGridList } from './index-
|
|
6
|
+
import { L as LinksGridList } from './index-ba8d718c.esm.js';
|
|
7
7
|
import { useApp } from '@backstage/core-plugin-api';
|
|
8
|
+
import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
8
9
|
import 'zen-observable';
|
|
9
10
|
import '@backstage/catalog-model';
|
|
10
11
|
import 'lodash';
|
|
@@ -95,4 +96,4 @@ const EntityLinksCard = (props) => {
|
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
export { EntityLinksCard };
|
|
98
|
-
//# sourceMappingURL=index-
|
|
99
|
+
//# sourceMappingURL=index-877315c2.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-877315c2.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\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 LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,WAAc,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAA,CAAA,CAAA;AAUpB,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,CAAA;AAAA,MACd,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA,MAC1B,UAAA,EACE,MAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,MAAS,GAAA,KAAA,CAAM,QAAQ,MAAO,CAAA,KAAA;AAAA,KAClE;AAAA,GACF,CAAA;AAAA,EACA,EAAE,MAAM,oCAAqC,EAAA;AAC/C,CAAA,CAAA;AAEO,SAAS,qBAAwB,GAAA;AACtC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,oHAG5B,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,WAAA;AAAA,MACN,QAAS,EAAA,MAAA;AAAA,MAC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AAA,CAAM,MAAW,KAAA,CAAA,mBACzB,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,IAAsB,CAEvB,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,KAAA,EAAO,MAAM,GAAI,CAAA,CAAC,EAAE,GAAK,EAAA,KAAA,EAAO,MAAY,MAAA;AAAA,QAC1C,MAAM,KAAS,IAAA,IAAA,GAAA,KAAA,GAAA,GAAA;AAAA,QACf,IAAM,EAAA,GAAA;AAAA,QACN,IAAA,EAAM,aAAa,IAAI,CAAA;AAAA,OACvB,CAAA,CAAA;AAAA,KAAA;AAAA,GAGR,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -3,8 +3,9 @@ import { useOutlet } from 'react-router-dom';
|
|
|
3
3
|
import { PageWithHeader, Content, ContentHeader, CreateButton, SupportButton } from '@backstage/core-components';
|
|
4
4
|
import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
5
5
|
import { EntityListProvider, CatalogFilterLayout, EntityKindPicker, EntityTypePicker, UserListPicker, EntityOwnerPicker, EntityLifecyclePicker, EntityTagPicker, EntityProcessingStatusPicker, EntityNamespacePicker } from '@backstage/plugin-catalog-react';
|
|
6
|
-
import { c as createComponentRouteRef, C as CatalogTable } from './index-
|
|
7
|
-
import {
|
|
6
|
+
import { c as createComponentRouteRef, C as CatalogTable } from './index-ba8d718c.esm.js';
|
|
7
|
+
import { createTranslationRef, useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
8
|
+
import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
8
9
|
import 'zen-observable';
|
|
9
10
|
import '@backstage/catalog-model';
|
|
10
11
|
import 'lodash';
|
|
@@ -33,7 +34,13 @@ import '@backstage/errors';
|
|
|
33
34
|
import '@backstage/catalog-client';
|
|
34
35
|
import '@backstage/plugin-search-react';
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
+
const catalogTranslationRef = createTranslationRef({
|
|
38
|
+
id: "catalog",
|
|
39
|
+
messages: {
|
|
40
|
+
catalog_page_title: `{{orgName}} Catalog`,
|
|
41
|
+
catalog_page_create_button_title: "Create"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
37
44
|
|
|
38
45
|
function DefaultCatalogPage(props) {
|
|
39
46
|
var _a;
|
|
@@ -48,11 +55,11 @@ function DefaultCatalogPage(props) {
|
|
|
48
55
|
} = props;
|
|
49
56
|
const orgName = (_a = useApi(configApiRef).getOptionalString("organization.name")) != null ? _a : "Backstage";
|
|
50
57
|
const createComponentLink = useRouteRef(createComponentRouteRef);
|
|
51
|
-
const {
|
|
52
|
-
return /* @__PURE__ */ React.createElement(PageWithHeader, { title:
|
|
58
|
+
const { t } = useTranslationRef(catalogTranslationRef);
|
|
59
|
+
return /* @__PURE__ */ React.createElement(PageWithHeader, { title: t("catalog_page_title", { orgName }), themeId: "home" }, /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "" }, /* @__PURE__ */ React.createElement(
|
|
53
60
|
CreateButton,
|
|
54
61
|
{
|
|
55
|
-
title:
|
|
62
|
+
title: t("catalog_page_create_button_title"),
|
|
56
63
|
to: createComponentLink && createComponentLink()
|
|
57
64
|
}
|
|
58
65
|
), /* @__PURE__ */ React.createElement(SupportButton, null, "All your software catalog entities")), /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(EntityKindPicker, { initialFilter: initialKind }), /* @__PURE__ */ React.createElement(EntityTypePicker, null), /* @__PURE__ */ React.createElement(UserListPicker, { initialFilter: initiallySelectedFilter }), /* @__PURE__ */ React.createElement(EntityOwnerPicker, { mode: ownerPickerMode }), /* @__PURE__ */ React.createElement(EntityLifecyclePicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null), /* @__PURE__ */ React.createElement(EntityProcessingStatusPicker, null), /* @__PURE__ */ React.createElement(EntityNamespacePicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
|
|
@@ -72,4 +79,4 @@ function CatalogPage(props) {
|
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
export { CatalogPage, DefaultCatalogPage };
|
|
75
|
-
//# sourceMappingURL=index-
|
|
82
|
+
//# sourceMappingURL=index-a9833792.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-a9833792.esm.js","sources":["../../src/translation.ts","../../src/components/CatalogPage/DefaultCatalogPage.tsx","../../src/components/CatalogPage/CatalogPage.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n catalog_page_title: `{{orgName}} Catalog`,\n catalog_page_create_button_title: 'Create',\n },\n});\n","/*\n * Copyright 2021 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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogFilterLayout,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityProcessingStatusPicker,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n EntityKindPicker,\n EntityNamespacePicker,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n ownerPickerMode,\n } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <PageWithHeader title={t('catalog_page_title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title={t('catalog_page_create_button_title')}\n to={createComponentLink && createComponentLink()}\n />\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n}\n","/*\n * Copyright 2021 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 { useOutlet } from 'react-router-dom';\nimport {\n DefaultCatalogPage,\n DefaultCatalogPageProps,\n} from './DefaultCatalogPage';\n\nexport function CatalogPage(props: DefaultCatalogPageProps) {\n const outlet = useOutlet();\n\n return outlet || <DefaultCatalogPage {...props} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,wBAAwB,oBAAqB,CAAA;AAAA,EACxD,EAAI,EAAA,SAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,kBAAoB,EAAA,CAAA,mBAAA,CAAA;AAAA,IACpB,gCAAkC,EAAA,QAAA;AAAA,GACpC;AACF,CAAC,CAAA;;ACoCM,SAAS,mBAAmB,KAAgC,EAAA;AA7DnE,EAAA,IAAA,EAAA,CAAA;AA8DE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,OAAA;AAAA,IACA,uBAA0B,GAAA,OAAA;AAAA,IAC1B,WAAc,GAAA,WAAA;AAAA,IACd,eAAe,EAAC;AAAA,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kBACtB,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,IAAgB,mBAChB,KAAA,CAAA,aAAA,CAAA,4BAAA,EAAA,IAA6B,mBAC7B,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,IAAsB,CACzB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAoB,CAAA,OAAA,EAApB,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,OAAA;AAAA,MACA,YAAA;AAAA,MACA,YAAA;AAAA,KAAA;AAAA,GAEJ,CACF,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;ACxFO,SAAS,YAAY,KAAgC,EAAA;AAC1D,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,OAAO,MAAU,oBAAA,KAAA,CAAA,aAAA,CAAC,kBAAoB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AAClD;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { A as AboutCard, a as AboutContent, b as AboutField } from './index-
|
|
1
|
+
export { A as AboutCard, a as AboutContent, b as AboutField } from './index-ba8d718c.esm.js';
|
|
2
|
+
import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
2
3
|
import 'zen-observable';
|
|
3
4
|
import '@backstage/catalog-model';
|
|
4
5
|
import 'lodash';
|
|
@@ -31,4 +32,4 @@ import '@material-ui/icons/Cancel';
|
|
|
31
32
|
import '@backstage/errors';
|
|
32
33
|
import '@backstage/catalog-client';
|
|
33
34
|
import '@backstage/plugin-search-react';
|
|
34
|
-
//# sourceMappingURL=index-
|
|
35
|
+
//# sourceMappingURL=index-b8cad66a.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-b8cad66a.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { isArray, isString, capitalize } from 'lodash';
|
|
1
|
+
import { D as DefaultStarredEntitiesApi } from './DefaultStarredEntitiesApi-cc4feb80.esm.js';
|
|
2
|
+
import { RELATION_PART_OF, RELATION_OWNED_BY, getEntitySourceLocation, ANNOTATION_EDIT_URL, parseEntityRef, DEFAULT_NAMESPACE, ANNOTATION_LOCATION, stringifyEntityRef, ANNOTATION_VIEW_URL } from '@backstage/catalog-model';
|
|
4
3
|
import { makeStyles, Typography, Grid, Box, useMediaQuery, ImageList, ImageListItem, Chip, Card, CardHeader, IconButton, Divider, CardContent, createStyles, Select, InputBase, MenuItem, ListItemIcon, ListItemText, Tooltip, Popover, MenuList, Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';
|
|
5
4
|
import { Link, MarkdownContent, HeaderIconLinkRow, OverflowTooltip, WarningPanel, CodeSnippet, Table, Page, Header, Progress, RoutedTabs, Content, HeaderLabel, ResponseErrorPanel, InfoCard } from '@backstage/core-components';
|
|
6
5
|
import React, { useCallback, useMemo, useState, useEffect } from 'react';
|
|
@@ -19,6 +18,7 @@ import { withStyles, makeStyles as makeStyles$1 } from '@material-ui/core/styles
|
|
|
19
18
|
import OpenInNew from '@material-ui/icons/OpenInNew';
|
|
20
19
|
import Star from '@material-ui/icons/Star';
|
|
21
20
|
import StarBorder from '@material-ui/icons/StarBorder';
|
|
21
|
+
import { capitalize } from 'lodash';
|
|
22
22
|
import { Alert } from '@material-ui/lab';
|
|
23
23
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
24
24
|
import BugReportIcon from '@material-ui/icons/BugReport';
|
|
@@ -31,79 +31,6 @@ import { assertError } from '@backstage/errors';
|
|
|
31
31
|
import { ENTITY_STATUS_CATALOG_PROCESSING_TYPE, CatalogClient } from '@backstage/catalog-client';
|
|
32
32
|
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react';
|
|
33
33
|
|
|
34
|
-
async function performMigrationToTheNewBucket({
|
|
35
|
-
storageApi
|
|
36
|
-
}) {
|
|
37
|
-
var _a;
|
|
38
|
-
const source = storageApi.forBucket("settings");
|
|
39
|
-
const target = storageApi.forBucket("starredEntities");
|
|
40
|
-
const oldStarredEntities = source.snapshot("starredEntities").value;
|
|
41
|
-
if (!isArray(oldStarredEntities)) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const targetEntities = new Set(
|
|
45
|
-
(_a = target.snapshot("entityRefs").value) != null ? _a : []
|
|
46
|
-
);
|
|
47
|
-
oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(
|
|
48
|
-
([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })
|
|
49
|
-
).forEach((e) => targetEntities.add(e));
|
|
50
|
-
await target.set("entityRefs", Array.from(targetEntities));
|
|
51
|
-
await source.remove("starredEntities");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var __defProp = Object.defineProperty;
|
|
55
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
56
|
-
var __publicField = (obj, key, value) => {
|
|
57
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
58
|
-
return value;
|
|
59
|
-
};
|
|
60
|
-
class DefaultStarredEntitiesApi {
|
|
61
|
-
constructor(opts) {
|
|
62
|
-
__publicField(this, "settingsStore");
|
|
63
|
-
__publicField(this, "starredEntities");
|
|
64
|
-
__publicField(this, "subscribers", /* @__PURE__ */ new Set());
|
|
65
|
-
__publicField(this, "observable", new ObservableImpl((subscriber) => {
|
|
66
|
-
subscriber.next(new Set(this.starredEntities));
|
|
67
|
-
this.subscribers.add(subscriber);
|
|
68
|
-
return () => {
|
|
69
|
-
this.subscribers.delete(subscriber);
|
|
70
|
-
};
|
|
71
|
-
}));
|
|
72
|
-
var _a;
|
|
73
|
-
performMigrationToTheNewBucket(opts).then();
|
|
74
|
-
this.settingsStore = opts.storageApi.forBucket("starredEntities");
|
|
75
|
-
this.starredEntities = new Set(
|
|
76
|
-
(_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []
|
|
77
|
-
);
|
|
78
|
-
this.settingsStore.observe$("entityRefs").subscribe({
|
|
79
|
-
next: (next) => {
|
|
80
|
-
var _a2;
|
|
81
|
-
this.starredEntities = new Set((_a2 = next.value) != null ? _a2 : []);
|
|
82
|
-
this.notifyChanges();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
async toggleStarred(entityRef) {
|
|
87
|
-
if (this.starredEntities.has(entityRef)) {
|
|
88
|
-
this.starredEntities.delete(entityRef);
|
|
89
|
-
} else {
|
|
90
|
-
this.starredEntities.add(entityRef);
|
|
91
|
-
}
|
|
92
|
-
await this.settingsStore.set(
|
|
93
|
-
"entityRefs",
|
|
94
|
-
Array.from(this.starredEntities)
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
starredEntitie$() {
|
|
98
|
-
return this.observable;
|
|
99
|
-
}
|
|
100
|
-
notifyChanges() {
|
|
101
|
-
for (const subscription of this.subscribers) {
|
|
102
|
-
subscription.next(new Set(this.starredEntities));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
34
|
const createComponentRouteRef = createExternalRouteRef({
|
|
108
35
|
id: "create-component",
|
|
109
36
|
optional: true
|
|
@@ -1536,18 +1463,12 @@ const catalogPlugin = createPlugin({
|
|
|
1536
1463
|
createComponent: createComponentRouteRef,
|
|
1537
1464
|
viewTechDoc: viewTechDocRouteRef,
|
|
1538
1465
|
createFromTemplate: createFromTemplateRouteRef
|
|
1539
|
-
},
|
|
1540
|
-
__experimentalConfigure(options) {
|
|
1541
|
-
const defaultOptions = {
|
|
1542
|
-
createButtonTitle: "Create"
|
|
1543
|
-
};
|
|
1544
|
-
return { ...defaultOptions, ...options };
|
|
1545
1466
|
}
|
|
1546
1467
|
});
|
|
1547
1468
|
const CatalogIndexPage = catalogPlugin.provide(
|
|
1548
1469
|
createRoutableExtension({
|
|
1549
1470
|
name: "CatalogIndexPage",
|
|
1550
|
-
component: () => import('./index-
|
|
1471
|
+
component: () => import('./index-a9833792.esm.js').then((m) => m.CatalogPage),
|
|
1551
1472
|
mountPoint: rootRouteRef
|
|
1552
1473
|
})
|
|
1553
1474
|
);
|
|
@@ -1562,7 +1483,7 @@ const EntityAboutCard = catalogPlugin.provide(
|
|
|
1562
1483
|
createComponentExtension({
|
|
1563
1484
|
name: "EntityAboutCard",
|
|
1564
1485
|
component: {
|
|
1565
|
-
lazy: () => import('./index-
|
|
1486
|
+
lazy: () => import('./index-b8cad66a.esm.js').then((m) => m.AboutCard)
|
|
1566
1487
|
}
|
|
1567
1488
|
})
|
|
1568
1489
|
);
|
|
@@ -1570,7 +1491,7 @@ const EntityLinksCard = catalogPlugin.provide(
|
|
|
1570
1491
|
createComponentExtension({
|
|
1571
1492
|
name: "EntityLinksCard",
|
|
1572
1493
|
component: {
|
|
1573
|
-
lazy: () => import('./index-
|
|
1494
|
+
lazy: () => import('./index-877315c2.esm.js').then((m) => m.EntityLinksCard)
|
|
1574
1495
|
}
|
|
1575
1496
|
})
|
|
1576
1497
|
);
|
|
@@ -1578,7 +1499,7 @@ const EntityLabelsCard = catalogPlugin.provide(
|
|
|
1578
1499
|
createComponentExtension({
|
|
1579
1500
|
name: "EntityLabelsCard",
|
|
1580
1501
|
component: {
|
|
1581
|
-
lazy: () => import('./index-
|
|
1502
|
+
lazy: () => import('./index-2f599706.esm.js').then((m) => m.EntityLabelsCard)
|
|
1582
1503
|
}
|
|
1583
1504
|
})
|
|
1584
1505
|
);
|
|
@@ -1659,12 +1580,12 @@ const RelatedEntitiesCard = catalogPlugin.provide(
|
|
|
1659
1580
|
const CatalogSearchResultListItem = catalogPlugin.provide(
|
|
1660
1581
|
createSearchResultListItemExtension({
|
|
1661
1582
|
name: "CatalogSearchResultListItem",
|
|
1662
|
-
component: () => import('./index-
|
|
1583
|
+
component: () => import('./index-3524e4e8.esm.js').then(
|
|
1663
1584
|
(m) => m.CatalogSearchResultListItem
|
|
1664
1585
|
),
|
|
1665
1586
|
predicate: (result) => result.type === "software-catalog"
|
|
1666
1587
|
})
|
|
1667
1588
|
);
|
|
1668
1589
|
|
|
1669
|
-
export { AboutCard as A, EntitySwitch as B, CatalogTable as C,
|
|
1670
|
-
//# sourceMappingURL=index-
|
|
1590
|
+
export { AboutCard as A, EntitySwitch as B, CatalogTable as C, isKind as D, EntityLabelsCard$1 as E, isNamespace as F, isComponentType as G, isResourceType as H, isEntityWith as I, FilteredEntityLayout as J, FilterContainer as K, LinksGridList as L, EntityListContainer as M, RelatedEntitiesCard as R, AboutContent as a, AboutField as b, createComponentRouteRef as c, CatalogEntityPage as d, CatalogIndexPage as e, catalogPlugin as f, EntityAboutCard as g, hasLabels as h, EntityDependencyOfComponentsCard as i, EntityDependsOnComponentsCard as j, EntityDependsOnResourcesCard as k, EntityHasComponentsCard as l, EntityHasResourcesCard as m, EntityHasSubcomponentsCard as n, EntityHasSystemsCard as o, EntityLinksCard as p, EntityLabelsCard as q, CatalogSearchResultListItem as r, CatalogKindHeader as s, EntityLayout as t, EntityOrphanWarning as u, isOrphan as v, EntityRelationWarning as w, hasRelationWarnings as x, EntityProcessingErrorsPanel as y, hasCatalogProcessingErrors as z };
|
|
1591
|
+
//# sourceMappingURL=index-ba8d718c.esm.js.map
|