@backstage/plugin-catalog-react 1.1.0-next.0 → 1.1.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 1.1.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0418447669: Added menu parent role for menu items accessibility
8
+ - Updated dependencies
9
+ - @backstage/core-components@0.9.4-next.0
10
+ - @backstage/core-plugin-api@1.0.2-next.0
11
+ - @backstage/plugin-permission-react@0.4.1-next.0
12
+
3
13
  ## 1.1.0-next.0
4
14
 
5
15
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "1.1.0-next.0",
3
+ "version": "1.1.0-next.1",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/dist/index.esm.js CHANGED
@@ -2025,7 +2025,8 @@ const UserListPicker = (props) => {
2025
2025
  className: classes.groupWrapper
2026
2026
  }, /* @__PURE__ */ React.createElement(List, {
2027
2027
  disablePadding: true,
2028
- dense: true
2028
+ dense: true,
2029
+ role: "menu"
2029
2030
  }, group.items.map((item) => {
2030
2031
  var _a2, _b;
2031
2032
  return /* @__PURE__ */ React.createElement(MenuItem, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/api.ts","../src/apis/StarredEntitiesApi/StarredEntitiesApi.ts","../src/apis/StarredEntitiesApi/MockStarredEntitiesApi.ts","../src/components/CatalogFilterLayout/CatalogFilterLayout.tsx","../src/hooks/useEntity.tsx","../src/utils/filters.ts","../src/utils/getEntityRelations.ts","../src/utils/getEntitySourceLocation.ts","../src/utils/isOwnerOf.ts","../src/hooks/useEntityListProvider.tsx","../src/routes.ts","../src/components/EntityRefLink/humanize.ts","../src/components/EntityRefLink/EntityRefLink.tsx","../src/components/EntityRefLink/EntityRefLinks.tsx","../src/filters.ts","../src/hooks/useEntityTypeFilter.tsx","../src/hooks/useRelatedEntities.ts","../src/hooks/useStarredEntities.ts","../src/hooks/useStarredEntity.ts","../src/hooks/useEntityOwnership.ts","../src/hooks/useEntityPermission.ts","../src/components/EntityKindPicker/EntityKindPicker.tsx","../src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx","../src/components/EntityOwnerPicker/EntityOwnerPicker.tsx","../src/components/EntitySearchBar/EntitySearchBar.tsx","../src/components/EntityTable/columns.tsx","../src/components/EntityTable/presets.tsx","../src/components/EntityTable/EntityTable.tsx","../src/components/EntityTagPicker/EntityTagPicker.tsx","../src/components/EntityTypePicker/EntityTypePicker.tsx","../src/components/FavoriteEntity/FavoriteEntity.tsx","../src/components/InspectEntityDialog/components/EntityKindIcon.tsx","../src/components/InspectEntityDialog/components/AncestryPage.tsx","../src/components/InspectEntityDialog/components/common.tsx","../src/components/InspectEntityDialog/components/ColocatedPage.tsx","../src/components/InspectEntityDialog/components/util.ts","../src/components/InspectEntityDialog/components/JsonPage.tsx","../src/components/InspectEntityDialog/components/OverviewPage.tsx","../src/components/InspectEntityDialog/components/YamlPage.tsx","../src/components/InspectEntityDialog/InspectEntityDialog.tsx","../src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts","../src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx","../src/components/UserListPicker/UserListPicker.tsx","../src/testUtils/providers.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 { CatalogApi } from '@backstage/catalog-client';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * The API reference for the {@link @backstage/catalog-client#CatalogApi}.\n * @public\n */\nexport const catalogApiRef = createApiRef<CatalogApi>({\n id: 'plugin.catalog.service',\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 { ApiRef, createApiRef } from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API to store starred entities\n *\n * @public\n */\nexport const starredEntitiesApiRef: ApiRef<StarredEntitiesApi> = createApiRef({\n id: 'catalog-react.starred-entities',\n});\n\n/**\n * An API to store and retrieve starred entities\n *\n * @public\n */\nexport interface StarredEntitiesApi {\n /**\n * Toggle the star state of the entity\n *\n * @param entityRef - an entity reference to toggle\n */\n toggleStarred(entityRef: string): Promise<void>;\n\n /**\n * Observe the set of starred entity references.\n */\n starredEntitie$(): Observable<Set<string>>;\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 { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { StarredEntitiesApi } from './StarredEntitiesApi';\n\n/**\n * An in-memory mock implementation of the StarredEntitiesApi.\n *\n * @public\n */\nexport class MockStarredEntitiesApi implements StarredEntitiesApi {\n private readonly starredEntities = new Set<string>();\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (!this.starredEntities.delete(entityRef)) {\n this.starredEntities.add(entityRef);\n }\n\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\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, { useState } from 'react';\nimport {\n Box,\n Button,\n Drawer,\n Grid,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { BackstageTheme } from '@backstage/theme';\n\n/** @public */\nexport const Filters = (props: { children: React.ReactNode }) => {\n const isMidSizeScreen = useMediaQuery<BackstageTheme>(theme =>\n theme.breakpoints.down('md'),\n );\n const theme = useTheme<BackstageTheme>();\n const [filterDrawerOpen, setFilterDrawerOpen] = useState<boolean>(false);\n\n return isMidSizeScreen ? (\n <>\n <Button\n style={{ marginTop: theme.spacing(1), marginLeft: theme.spacing(1) }}\n onClick={() => setFilterDrawerOpen(true)}\n startIcon={<FilterListIcon />}\n >\n Filters\n </Button>\n <Drawer\n open={filterDrawerOpen}\n onClose={() => setFilterDrawerOpen(false)}\n anchor=\"left\"\n disableAutoFocus\n keepMounted\n variant=\"temporary\"\n >\n <Box m={2}>\n <Typography\n variant=\"h6\"\n component=\"h2\"\n style={{ marginBottom: theme.spacing(1) }}\n >\n Filters\n </Typography>\n {props.children}\n </Box>\n </Drawer>\n </>\n ) : (\n <Grid item lg={2}>\n {props.children}\n </Grid>\n );\n};\n\n/** @public */\nexport const Content = (props: { children: React.ReactNode }) => {\n return (\n <Grid item xs={12} lg={10}>\n {props.children}\n </Grid>\n );\n};\n\n/** @public */\nexport const CatalogFilterLayout = (props: { children: React.ReactNode }) => {\n return (\n <Grid container style={{ position: 'relative' }}>\n {props.children}\n </Grid>\n );\n};\n\nCatalogFilterLayout.Filters = Filters;\nCatalogFilterLayout.Content = Content;\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 */\nimport { Entity } from '@backstage/catalog-model';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport React, { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = ({\n children,\n entity,\n loading,\n error,\n refresh,\n}: AsyncEntityProviderProps) => {\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n {children}\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\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 { Entity } from '@backstage/catalog-model';\nimport { EntityFilter } from '../types';\n\nexport function reduceCatalogFilters(\n filters: EntityFilter[],\n): Record<string, string | symbol | (string | symbol)[]> {\n return filters.reduce((compoundFilter, filter) => {\n return {\n ...compoundFilter,\n ...(filter.getCatalogFilters ? filter.getCatalogFilters() : {}),\n };\n }, {} as Record<string, string | symbol | (string | symbol)[]>);\n}\n\nexport function reduceEntityFilters(\n filters: EntityFilter[],\n): (entity: Entity) => boolean {\n return (entity: Entity) =>\n filters.every(\n filter => !filter.filterEntity || filter.filterEntity(entity),\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 {\n Entity,\n CompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\n// TODO(freben): This should be returning entity refs instead\n/**\n * Get the related entity references.\n *\n * @public\n */\nexport function getEntityRelations(\n entity: Entity | undefined,\n relationType: string,\n filter?: { kind: string },\n): CompoundEntityRef[] {\n let entityNames =\n entity?.relations\n ?.filter(r => r.type === relationType)\n .map(r => parseEntityRef(r.targetRef)) || [];\n\n if (filter?.kind) {\n entityNames = entityNames.filter(\n e =>\n e.kind.toLocaleLowerCase('en-US') ===\n filter.kind.toLocaleLowerCase('en-US'),\n );\n }\n\n return entityNames;\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 {\n ANNOTATION_SOURCE_LOCATION,\n Entity,\n parseLocationRef,\n} from '@backstage/catalog-model';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\n\n/** @public */\nexport type EntitySourceLocation = {\n locationTargetUrl: string;\n integrationType?: string;\n};\n\n/** @public */\nexport function getEntitySourceLocation(\n entity: Entity,\n scmIntegrationsApi: ScmIntegrationRegistry,\n): EntitySourceLocation | undefined {\n const sourceLocation =\n entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];\n\n if (!sourceLocation) {\n return undefined;\n }\n\n try {\n const sourceLocationRef = parseLocationRef(sourceLocation);\n const integration = scmIntegrationsApi.byUrl(sourceLocationRef.target);\n return {\n locationTargetUrl: sourceLocationRef.target,\n integrationType: integration?.type,\n };\n } catch {\n return undefined;\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 {\n Entity,\n getCompoundEntityRef,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { getEntityRelations } from './getEntityRelations';\n\n/**\n * Returns true if the `owner` argument is a direct owner on the `entity` argument.\n *\n * @alpha\n * @remarks\n *\n * Note that this ownership is not the same as using the claims in the auth-resolver, it only will take into account ownership as expressed by direct entity relations.\n * It doesn't know anything about the additional groups that a user might belong to which the claims contain.\n */\nexport function isOwnerOf(owner: Entity, entity: Entity) {\n const possibleOwners = new Set(\n [\n ...getEntityRelations(owner, RELATION_MEMBER_OF, { kind: 'group' }),\n ...(owner ? [getCompoundEntityRef(owner)] : []),\n ].map(stringifyEntityRef),\n );\n\n const owners = getEntityRelations(entity, RELATION_OWNED_BY).map(\n stringifyEntityRef,\n );\n\n for (const ownerItem of owners) {\n if (possibleOwners.has(ownerItem)) {\n return true;\n }\n }\n\n return false;\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 { Entity } from '@backstage/catalog-model';\nimport { compact, isEqual } from 'lodash';\nimport qs from 'qs';\nimport React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport useMountedState from 'react-use/lib/useMountedState';\nimport { catalogApiRef } from '../api';\nimport {\n EntityKindFilter,\n EntityLifecycleFilter,\n EntityOwnerFilter,\n EntityTagFilter,\n EntityTextFilter,\n EntityTypeFilter,\n UserListFilter,\n} from '../filters';\nimport { EntityFilter } from '../types';\nimport { reduceCatalogFilters, reduceEntityFilters } from '../utils';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport type DefaultEntityFilters = {\n kind?: EntityKindFilter;\n type?: EntityTypeFilter;\n user?: UserListFilter;\n owners?: EntityOwnerFilter;\n lifecycles?: EntityLifecycleFilter;\n tags?: EntityTagFilter;\n text?: EntityTextFilter;\n};\n\n/** @public */\nexport type EntityListContextProps<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n> = {\n /**\n * The currently registered filters, adhering to the shape of DefaultEntityFilters or an extension\n * of that default (to add custom filter types).\n */\n filters: EntityFilters;\n\n /**\n * The resolved list of catalog entities, after all filters are applied.\n */\n entities: Entity[];\n\n /**\n * The resolved list of catalog entities, after _only catalog-backend_ filters are applied.\n */\n backendEntities: Entity[];\n\n /**\n * Update one or more of the registered filters. Optional filters can be set to `undefined` to\n * reset the filter.\n */\n updateFilters: (\n filters:\n | Partial<EntityFilters>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => void;\n\n /**\n * Filter values from query parameters.\n */\n queryParameters: Partial<Record<keyof EntityFilters, string | string[]>>;\n\n loading: boolean;\n error?: Error;\n};\n\n/**\n * Creates new context for entity listing and filtering.\n * @public\n */\nexport const EntityListContext = createContext<\n EntityListContextProps<any> | undefined\n>(undefined);\n\ntype OutputState<EntityFilters extends DefaultEntityFilters> = {\n appliedFilters: EntityFilters;\n entities: Entity[];\n backendEntities: Entity[];\n};\n\n/**\n * Provides entities and filters for a catalog listing.\n * @public\n */\nexport const EntityListProvider = <EntityFilters extends DefaultEntityFilters>({\n children,\n}: PropsWithChildren<{}>) => {\n const isMounted = useMountedState();\n const catalogApi = useApi(catalogApiRef);\n const [requestedFilters, setRequestedFilters] = useState<EntityFilters>(\n {} as EntityFilters,\n );\n\n // We use react-router's useLocation hook so updates from external sources trigger an update to\n // the queryParameters in outputState. Updates from this hook use replaceState below and won't\n // trigger a useLocation change; this would instead come from an external source, such as a manual\n // update of the URL or two catalog sidebar links with different catalog filters.\n const location = useLocation();\n const queryParameters = useMemo(\n () =>\n (qs.parse(location.search, {\n ignoreQueryPrefix: true,\n }).filters ?? {}) as Record<string, string | string[]>,\n [location],\n );\n\n const [outputState, setOutputState] = useState<OutputState<EntityFilters>>(\n () => {\n return {\n appliedFilters: {} as EntityFilters,\n entities: [],\n backendEntities: [],\n };\n },\n );\n\n // The main async filter worker. Note that while it has a lot of dependencies\n // in terms of its implementation, the triggering only happens (debounced)\n // based on the requested filters changing.\n const [{ loading, error }, refresh] = useAsyncFn(\n async () => {\n const compacted = compact(Object.values(requestedFilters));\n const entityFilter = reduceEntityFilters(compacted);\n const backendFilter = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n const queryParams = Object.keys(requestedFilters).reduce(\n (params, key) => {\n const filter: EntityFilter | undefined =\n requestedFilters[key as keyof EntityFilters];\n if (filter?.toQueryValue) {\n params[key] = filter.toQueryValue();\n }\n return params;\n },\n {} as Record<string, string | string[]>,\n );\n\n // TODO(mtlewis): currently entities will never be requested unless\n // there's at least one filter, we should allow an initial request\n // to happen with no filters.\n if (!isEqual(previousBackendFilter, backendFilter)) {\n // TODO(timbonicus): should limit fields here, but would need filter\n // fields + table columns\n const response = await catalogApi.getEntities({\n filter: backendFilter,\n });\n setOutputState({\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n });\n } else {\n setOutputState({\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities: outputState.backendEntities.filter(entityFilter),\n });\n }\n\n if (isMounted()) {\n const oldParams = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n });\n const newParams = qs.stringify(\n { ...oldParams, filters: queryParams },\n { addQueryPrefix: true, arrayFormat: 'repeat' },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing, since we\n // don't want there to be back/forward slots for every single filter\n // change.\n window.history?.replaceState(null, document.title, newUrl);\n }\n },\n [catalogApi, queryParameters, requestedFilters, outputState],\n { loading: true },\n );\n\n // Slight debounce on the refresh, since (especially on page load) several\n // filters will be calling this in rapid succession.\n useDebounce(refresh, 10, [requestedFilters]);\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<EntityFilter>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => {\n setRequestedFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [],\n );\n\n const value = useMemo(\n () => ({\n filters: outputState.appliedFilters,\n entities: outputState.entities,\n backendEntities: outputState.backendEntities,\n updateFilters,\n queryParameters,\n loading,\n error,\n }),\n [outputState, updateFilters, queryParameters, loading, error],\n );\n\n return (\n <EntityListContext.Provider value={value}>\n {children}\n </EntityListContext.Provider>\n );\n};\n\n/**\n * Hook for interacting with the entity list context provided by the {@link EntityListProvider}.\n * @public\n */\nexport function useEntityList<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n>(): EntityListContextProps<EntityFilters> {\n const context = useContext(EntityListContext);\n if (!context)\n throw new Error('useEntityList must be used within EntityListProvider');\n return context;\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 { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { createRouteRef } from '@backstage/core-plugin-api';\nimport { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\n/**\n * A stable route ref that points to the catalog page for an individual entity.\n *\n * This `RouteRef` can be imported and used directly, and does not need to be referenced\n * via an `ExternalRouteRef`.\n *\n * If you want to replace the `EntityPage` from `@backstage/catalog-plugin` in your app,\n * you need to use the `entityRouteRef` as the mount point instead of your own.\n * @public\n */\nexport const entityRouteRef = getOrCreateGlobalSingleton(\n 'catalog:entity-route-ref',\n () =>\n createRouteRef({\n id: 'catalog:entity',\n params: ['namespace', 'kind', 'name'],\n }),\n);\n\n/**\n * Utility function to get suitable route params for entityRoute, given an\n * @public\n */\nexport function entityRouteParams(entity: Entity) {\n return {\n kind: entity.kind.toLocaleLowerCase('en-US'),\n namespace:\n entity.metadata.namespace?.toLocaleLowerCase('en-US') ??\n DEFAULT_NAMESPACE,\n name: entity.metadata.name,\n } as const;\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 {\n Entity,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n} from '@backstage/catalog-model';\n\n/** @public */\nexport function humanizeEntityRef(\n entityRef: Entity | CompoundEntityRef,\n opts?: { defaultKind?: string },\n) {\n const defaultKind = opts?.defaultKind;\n let kind;\n let namespace;\n let name;\n\n if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n if (namespace === DEFAULT_NAMESPACE) {\n namespace = undefined;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n kind =\n defaultKind && defaultKind.toLocaleLowerCase('en-US') === kind\n ? undefined\n : kind;\n return `${kind ? `${kind}:` : ''}${namespace ? `${namespace}/` : ''}${name}`;\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 {\n Entity,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport React, { forwardRef } from 'react';\nimport { entityRouteRef } from '../../routes';\nimport { humanizeEntityRef } from './humanize';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { Tooltip } from '@material-ui/core';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n title?: string;\n children?: React.ReactNode;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const { entityRef, defaultKind, title, children, ...linkProps } = props;\n const entityRoute = useRouteRef(entityRouteRef);\n\n let kind;\n let namespace;\n let name;\n\n if (typeof entityRef === 'string') {\n const parsed = parseEntityRef(entityRef);\n kind = parsed.kind;\n namespace = parsed.namespace;\n name = parsed.name;\n } else if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n namespace = namespace?.toLocaleLowerCase('en-US') ?? DEFAULT_NAMESPACE;\n\n const routeParams = { kind, namespace, name };\n const formattedEntityRefTitle = humanizeEntityRef(\n { kind, namespace, name },\n { defaultKind },\n );\n\n const link = (\n <Link {...linkProps} ref={ref} to={entityRoute(routeParams)}>\n {children}\n {!children && (title ?? formattedEntityRefTitle)}\n </Link>\n );\n\n return title ? (\n <Tooltip title={formattedEntityRefTitle}>{link}</Tooltip>\n ) : (\n link\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\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 { Entity, CompoundEntityRef } from '@backstage/catalog-model';\nimport React from 'react';\nimport { EntityRefLink } from './EntityRefLink';\nimport { LinkProps } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinksProps = {\n entityRefs: (string | Entity | CompoundEntityRef)[];\n defaultKind?: string;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a list of clickable links to entities.\n *\n * @public\n */\nexport function EntityRefLinks(props: EntityRefLinksProps) {\n const { entityRefs, defaultKind, ...linkProps } = props;\n return (\n <>\n {entityRefs.map((r, i) => (\n <React.Fragment key={i}>\n {i > 0 && ', '}\n <EntityRefLink\n {...linkProps}\n entityRef={r}\n defaultKind={defaultKind}\n />\n </React.Fragment>\n ))}\n </>\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 { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { humanizeEntityRef } from './components/EntityRefLink';\nimport { EntityFilter, UserListFilterKind } from './types';\nimport { getEntityRelations } from './utils';\n\n/**\n * Filter entities based on Kind.\n * @public\n */\nexport class EntityKindFilter implements EntityFilter {\n constructor(readonly value: string) {}\n\n getCatalogFilters(): Record<string, string | string[]> {\n return { kind: this.value };\n }\n\n toQueryValue(): string {\n return this.value;\n }\n}\n\n/**\n * Filters entities based on type\n * @public\n */\nexport class EntityTypeFilter implements EntityFilter {\n constructor(readonly value: string | string[]) {}\n\n // Simplify `string | string[]` for consumers, always returns an array\n getTypes(): string[] {\n return Array.isArray(this.value) ? this.value : [this.value];\n }\n\n getCatalogFilters(): Record<string, string | string[]> {\n return { 'spec.type': this.getTypes() };\n }\n\n toQueryValue(): string[] {\n return this.getTypes();\n }\n}\n\n/**\n * Filters entities based on tag.\n * @public\n */\nexport class EntityTagFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.every(v => (entity.metadata.tags ?? []).includes(v));\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities where the text matches spec, title or tags.\n * @public\n */\nexport class EntityTextFilter implements EntityFilter {\n constructor(readonly value: string) {}\n\n filterEntity(entity: Entity): boolean {\n const upperCaseValue = this.value.toLocaleUpperCase('en-US');\n\n return (\n entity.metadata.name\n .toLocaleUpperCase('en-US')\n .includes(upperCaseValue) ||\n `${entity.metadata.title}`\n .toLocaleUpperCase('en-US')\n .includes(upperCaseValue) ||\n entity.metadata.tags\n ?.join('')\n .toLocaleUpperCase('en-US')\n .indexOf(upperCaseValue) !== -1\n );\n }\n}\n\n/**\n * Filter matching entities that are owned by group.\n * @public\n */\nexport class EntityOwnerFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.some(v =>\n getEntityRelations(entity, RELATION_OWNED_BY).some(\n o => humanizeEntityRef(o, { defaultKind: 'group' }) === v,\n ),\n );\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities on lifecycle.\n * @public\n */\nexport class EntityLifecycleFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.some(v => entity.spec?.lifecycle === v);\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities based on whatever the user has starred or owns them.\n * @public\n */\nexport class UserListFilter implements EntityFilter {\n constructor(\n readonly value: UserListFilterKind,\n readonly isOwnedEntity: (entity: Entity) => boolean,\n readonly isStarredEntity: (entity: Entity) => boolean,\n ) {}\n\n filterEntity(entity: Entity): boolean {\n switch (this.value) {\n case 'owned':\n return this.isOwnedEntity(entity);\n case 'starred':\n return this.isStarredEntity(entity);\n default:\n return true;\n }\n }\n\n toQueryValue(): string {\n return this.value;\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 { useEffect, useMemo, useRef, useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '../api';\nimport { useEntityList } from './useEntityListProvider';\nimport { EntityTypeFilter } from '../filters';\n\n/**\n * A hook built on top of `useEntityList` for enabling selection of valid `spec.type` values\n * based on the selected EntityKindFilter.\n * @public\n */\nexport function useEntityTypeFilter(): {\n loading: boolean;\n error?: Error;\n availableTypes: string[];\n selectedTypes: string[];\n setSelectedTypes: (types: string[]) => void;\n} {\n const catalogApi = useApi(catalogApiRef);\n const {\n filters: { kind: kindFilter, type: typeFilter },\n queryParameters: { type: typeParameter },\n updateFilters,\n } = useEntityList();\n\n const flattenedQueryTypes = useMemo(\n () => [typeParameter].flat().filter(Boolean) as string[],\n [typeParameter],\n );\n\n const [selectedTypes, setSelectedTypes] = useState(\n flattenedQueryTypes.length\n ? flattenedQueryTypes\n : typeFilter?.getTypes() ?? [],\n );\n\n // Set selected types on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (flattenedQueryTypes.length) {\n setSelectedTypes(flattenedQueryTypes);\n }\n }, [flattenedQueryTypes]);\n\n const [availableTypes, setAvailableTypes] = useState<string[]>([]);\n const kind = useMemo(() => kindFilter?.value, [kindFilter]);\n\n // Load all valid spec.type values straight from the catalogApi, paying attention to only the\n // kind filter for a complete list.\n const {\n error,\n loading,\n value: facets,\n } = useAsync(async () => {\n if (kind) {\n const items = await catalogApi\n .getEntityFacets({\n filter: { kind },\n facets: ['spec.type'],\n })\n .then(response => response.facets['spec.type'] || []);\n return items;\n }\n return [];\n }, [kind, catalogApi]);\n\n const facetsRef = useRef(facets);\n useEffect(() => {\n const oldFacets = facetsRef.current;\n facetsRef.current = facets;\n // Delay processing hook until kind and facets load updates have settled to generate list of types;\n // This prevents resetting the type filter due to saved type value from query params not matching the\n // empty set of type values while values are still being loaded; also only run this hook on changes\n // to facets\n if (loading || !kind || oldFacets === facets || !facets) {\n return;\n }\n\n // Sort by facet count descending, so the most common types appear on top\n const newTypes = sortBy(facets, f => -f.count).map(f => f.value);\n setAvailableTypes(newTypes);\n\n // Update type filter to only valid values when the list of available types has changed\n const stillValidTypes = selectedTypes.filter(value =>\n newTypes.includes(value),\n );\n if (!isEqual(selectedTypes, stillValidTypes)) {\n setSelectedTypes(stillValidTypes);\n }\n }, [loading, kind, selectedTypes, setSelectedTypes, facets]);\n\n useEffect(() => {\n updateFilters({\n type: selectedTypes.length\n ? new EntityTypeFilter(selectedTypes)\n : undefined,\n });\n }, [selectedTypes, updateFilters]);\n\n return {\n loading,\n error,\n availableTypes,\n selectedTypes,\n setSelectedTypes,\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 */\nimport { Entity, parseEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { chunk, groupBy } from 'lodash';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../api';\n\nconst BATCH_SIZE = 20;\n\n/** @public */\nexport function useRelatedEntities(\n entity: Entity,\n relationFilter: { type?: string; kind?: string },\n): {\n entities: Entity[] | undefined;\n loading: boolean;\n error: Error | undefined;\n} {\n const filterByTypeLower = relationFilter?.type?.toLocaleLowerCase('en-US');\n const filterByKindLower = relationFilter?.kind?.toLocaleLowerCase('en-US');\n\n const catalogApi = useApi(catalogApiRef);\n const {\n loading,\n value: entities,\n error,\n } = useAsync(async () => {\n const relations = entity.relations\n ?.map(r => ({ type: r.type, target: parseEntityRef(r.targetRef) }))\n .filter(\n r =>\n (!filterByTypeLower ||\n r.type.toLocaleLowerCase('en-US') === filterByTypeLower) &&\n (!filterByKindLower || r.target.kind === filterByKindLower),\n );\n\n if (!relations) {\n return [];\n }\n\n // Group the relations by kind and namespace to reduce the size of the request query string.\n // Without this grouping, the kind and namespace would need to be specified for each relation, e.g.\n // `filter=kind=component,namespace=default,name=example1&filter=kind=component,namespace=default,name=example2`\n // with grouping, we can generate a query a string like\n // `filter=kind=component,namespace=default,name=example1,example2`\n const relationsByKindAndNamespace = Object.values(\n groupBy(relations, ({ target }) => {\n return `${target.kind}:${target.namespace}`.toLocaleLowerCase('en-US');\n }),\n );\n\n // Split the names within each group into batches to further reduce the query string length.\n const batchedRelationsByKindAndNamespace: {\n kind: string;\n namespace: string;\n nameBatches: string[][];\n }[] = [];\n for (const rs of relationsByKindAndNamespace) {\n batchedRelationsByKindAndNamespace.push({\n // All relations in a group have the same kind and namespace, so its arbitrary which we pick\n kind: rs[0].target.kind,\n namespace: rs[0].target.namespace,\n nameBatches: chunk(\n rs.map(r => r.target.name),\n BATCH_SIZE,\n ),\n });\n }\n\n const results = await Promise.all(\n batchedRelationsByKindAndNamespace.flatMap(rs => {\n return rs.nameBatches.map(names => {\n return catalogApi.getEntities({\n filter: {\n kind: rs.kind,\n 'metadata.namespace': rs.namespace,\n 'metadata.name': names,\n },\n });\n });\n }),\n );\n\n return results.flatMap(r => r.items);\n }, [entity, filterByTypeLower, filterByKindLower]);\n\n return {\n entities,\n loading,\n error,\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 {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback } from 'react';\nimport useObservable from 'react-use/lib/useObservable';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntities(): {\n starredEntities: Set<string>;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n isStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const starredEntities = useObservable(\n starredEntitiesApi.starredEntitie$(),\n new Set<string>(),\n );\n\n const isStarredEntity = useCallback(\n (entityOrRef: Entity | CompoundEntityRef | string) =>\n starredEntities.has(getEntityRef(entityOrRef)),\n [starredEntities],\n );\n\n const toggleStarredEntity = useCallback(\n (entityOrRef: Entity | CompoundEntityRef | string) =>\n starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [starredEntitiesApi],\n );\n\n return {\n starredEntities,\n toggleStarredEntity,\n isStarredEntity,\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 Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback, useEffect, useState } from 'react';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntity(\n entityOrRef: Entity | CompoundEntityRef | string,\n): {\n toggleStarredEntity: () => void;\n isStarredEntity: boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const [isStarredEntity, setIsStarredEntity] = useState(false);\n\n useEffect(() => {\n const subscription = starredEntitiesApi.starredEntitie$().subscribe({\n next(starredEntities: Set<string>) {\n setIsStarredEntity(starredEntities.has(getEntityRef(entityOrRef)));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [entityOrRef, starredEntitiesApi]);\n\n const toggleStarredEntity = useCallback(\n () => starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [entityOrRef, starredEntitiesApi],\n );\n\n return {\n toggleStarredEntity,\n isStarredEntity,\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 Entity,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { getEntityRelations } from '../utils/getEntityRelations';\n\n/**\n * Returns a function that checks whether the currently signed-in user is an\n * owner of a given entity. When the hook is initially mounted, the loading\n * flag will be true and the results returned from the function will always be\n * false.\n *\n * @public\n *\n * @returns a function that checks if the signed in user owns an entity\n */\nexport function useEntityOwnership(): {\n loading: boolean;\n isOwnedEntity: (entity: Entity) => boolean;\n} {\n const identityApi = useApi(identityApiRef);\n\n // Trigger load only on mount\n const { loading, value: refs } = useAsync(async () => {\n const { ownershipEntityRefs } = await identityApi.getBackstageIdentity();\n return ownershipEntityRefs;\n }, []);\n\n const isOwnedEntity = useMemo(() => {\n const myOwnerRefs = new Set(refs ?? []);\n return (entity: Entity) => {\n const entityOwnerRefs = getEntityRelations(entity, RELATION_OWNED_BY).map(\n stringifyEntityRef,\n );\n for (const ref of entityOwnerRefs) {\n if (myOwnerRefs.has(ref)) {\n return true;\n }\n }\n return false;\n };\n }, [refs]);\n\n return useMemo(() => ({ loading, isOwnedEntity }), [loading, isOwnedEntity]);\n}\n","/*\n * Copyright 2022 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 { ResourcePermission } from '@backstage/plugin-permission-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { useAsyncEntity } from './useEntity';\n\n/**\n * A thin wrapper around the\n * {@link @backstage/plugin-permission-react#usePermission} hook which uses the\n * current entity in context to make an authorization request for the given\n * {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.\n *\n * Note: this hook blocks the permission request until the entity has loaded in\n * context. If you have the entityRef and need concurrent requests, use the\n * `usePermission` hook directly.\n * @alpha\n */\nexport function useEntityPermission(\n // TODO(joeporpeglia) Replace with `CatalogEntityPermission` when the issue described in\n // https://github.com/backstage/backstage/pull/10128 is fixed.\n permission: ResourcePermission<'catalog-entity'>,\n): {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n} {\n const {\n entity,\n loading: loadingEntity,\n error: entityError,\n } = useAsyncEntity();\n const {\n allowed,\n loading: loadingPermission,\n error: permissionError,\n } = usePermission({\n permission,\n resourceRef: entity ? stringifyEntityRef(entity) : undefined,\n });\n\n if (loadingEntity || loadingPermission) {\n return { loading: true, allowed: false };\n }\n if (entityError) {\n return { loading: false, allowed: false, error: entityError };\n }\n return { loading: false, allowed, error: permissionError };\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, { useEffect, useState } from 'react';\nimport { Alert } from '@material-ui/lab';\nimport { useEntityList } from '../../hooks';\nimport { EntityKindFilter } from '../../filters';\n\n/**\n * Props for {@link EntityKindPicker}.\n *\n * @public\n */\nexport interface EntityKindPickerProps {\n initialFilter?: string;\n hidden: boolean;\n}\n\n/** @public */\nexport const EntityKindPicker = (props: EntityKindPickerProps) => {\n const { initialFilter, hidden } = props;\n\n const {\n updateFilters,\n queryParameters: { kind: kindParameter },\n } = useEntityList();\n const [selectedKind] = useState([kindParameter].flat()[0] ?? initialFilter);\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined,\n });\n }, [selectedKind, updateFilters]);\n\n if (hidden) return null;\n\n // TODO(timbonicus): This should load available kinds from the catalog-backend, similar to\n // EntityTypePicker.\n\n return <Alert severity=\"warning\">Kind filter not yet available</Alert>;\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 { Entity } from '@backstage/catalog-model';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityLifecycleFilter } from '../../filters';\n\n/** @public */\nexport type CatalogReactEntityLifecyclePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityLifecyclePicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityLifecyclePicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n backendEntities,\n filters,\n queryParameters: { lifecycles: lifecyclesParameter },\n } = useEntityList();\n\n const queryParamLifecycles = useMemo(\n () => [lifecyclesParameter].flat().filter(Boolean) as string[],\n [lifecyclesParameter],\n );\n\n const [selectedLifecycles, setSelectedLifecycles] = useState(\n queryParamLifecycles.length\n ? queryParamLifecycles\n : filters.lifecycles?.values ?? [],\n );\n\n // Set selected lifecycles on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamLifecycles.length) {\n setSelectedLifecycles(queryParamLifecycles);\n }\n }, [queryParamLifecycles]);\n\n useEffect(() => {\n updateFilters({\n lifecycles: selectedLifecycles.length\n ? new EntityLifecycleFilter(selectedLifecycles)\n : undefined,\n });\n }, [selectedLifecycles, updateFilters]);\n\n const availableLifecycles = useMemo(\n () =>\n [\n ...new Set(\n backendEntities\n .map((e: Entity) => e.spec?.lifecycle)\n .filter(Boolean) as string[],\n ),\n ].sort(),\n [backendEntities],\n );\n\n if (!availableLifecycles.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Lifecycle</Typography>\n <Autocomplete\n aria-label=\"Lifecycle\"\n multiple\n options={availableLifecycles}\n value={selectedLifecycles}\n onChange={(_: object, value: string[]) => setSelectedLifecycles(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"lifecycle-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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 { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityOwnerFilter } from '../../filters';\nimport { getEntityRelations } from '../../utils';\nimport { humanizeEntityRef } from '../EntityRefLink';\n\n/** @public */\nexport type CatalogReactEntityOwnerPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityOwnerPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityOwnerPicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n backendEntities,\n filters,\n queryParameters: { owners: ownersParameter },\n } = useEntityList();\n\n const queryParamOwners = useMemo(\n () => [ownersParameter].flat().filter(Boolean) as string[],\n [ownersParameter],\n );\n\n const [selectedOwners, setSelectedOwners] = useState(\n queryParamOwners.length ? queryParamOwners : filters.owners?.values ?? [],\n );\n\n // Set selected owners on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamOwners.length) {\n setSelectedOwners(queryParamOwners);\n }\n }, [queryParamOwners]);\n\n useEffect(() => {\n updateFilters({\n owners: selectedOwners.length\n ? new EntityOwnerFilter(selectedOwners)\n : undefined,\n });\n }, [selectedOwners, updateFilters]);\n\n const availableOwners = useMemo(\n () =>\n [\n ...new Set(\n backendEntities\n .flatMap((e: Entity) =>\n getEntityRelations(e, RELATION_OWNED_BY).map(o =>\n humanizeEntityRef(o, { defaultKind: 'group' }),\n ),\n )\n .filter(Boolean) as string[],\n ),\n ].sort(),\n [backendEntities],\n );\n\n if (!availableOwners.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Owner</Typography>\n <Autocomplete\n multiple\n aria-label=\"Owner\"\n options={availableOwners}\n value={selectedOwners}\n onChange={(_: object, value: string[]) => setSelectedOwners(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"owner-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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 {\n FormControl,\n IconButton,\n Input,\n InputAdornment,\n makeStyles,\n Toolbar,\n} from '@material-ui/core';\nimport Clear from '@material-ui/icons/Clear';\nimport Search from '@material-ui/icons/Search';\nimport React, { useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityTextFilter } from '../../filters';\n\n/** @public */\nexport type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';\n\nconst useStyles = makeStyles(\n _theme => ({\n searchToolbar: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n input: {},\n }),\n {\n name: 'CatalogReactEntitySearchBar',\n },\n);\n\n/**\n * Renders search bar for filtering the entity list.\n * @public\n */\nexport const EntitySearchBar = () => {\n const classes = useStyles();\n\n const { filters, updateFilters } = useEntityList();\n const [search, setSearch] = useState(filters.text?.value ?? '');\n\n useDebounce(\n () => {\n updateFilters({\n text: search.length ? new EntityTextFilter(search) : undefined,\n });\n },\n 250,\n [search, updateFilters],\n );\n\n return (\n <Toolbar className={classes.searchToolbar}>\n <FormControl>\n <Input\n aria-label=\"search\"\n id=\"input-with-icon-adornment\"\n className={classes.input}\n placeholder=\"Search\"\n autoComplete=\"off\"\n onChange={event => setSearch(event.target.value)}\n value={search}\n startAdornment={\n <InputAdornment position=\"start\">\n <Search />\n </InputAdornment>\n }\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear search\"\n onClick={() => setSearch('')}\n edge=\"end\"\n disabled={search.length === 0}\n >\n <Clear />\n </IconButton>\n </InputAdornment>\n }\n />\n </FormControl>\n </Toolbar>\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 {\n Entity,\n CompoundEntityRef,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport React from 'react';\nimport { getEntityRelations } from '../../utils';\nimport {\n EntityRefLink,\n EntityRefLinks,\n humanizeEntityRef,\n} from '../EntityRefLink';\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn<T extends Entity>(options: {\n defaultKind?: string;\n }): TableColumn<T> {\n const { defaultKind } = options;\n function formatContent(entity: T): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind,\n })\n );\n }\n\n return {\n title: 'Name',\n highlight: true,\n customFilterAndSearch(filter, entity) {\n // TODO: We could implement this more efficiently, like searching over\n // each field that is displayed individually (kind, namespace, name).\n // but that might confuse the user as it will behave different than a\n // simple text search.\n // Another alternative would be to cache the values. But writing them\n // into the entity feels bad too.\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={defaultKind}\n title={entity.metadata?.title}\n />\n ),\n };\n },\n createEntityRelationColumn<T extends Entity>({\n title,\n relation,\n defaultKind,\n filter: entityFilter,\n }: {\n title: string;\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n }): TableColumn<T> {\n function getRelations(entity: T): CompoundEntityRef[] {\n return getEntityRelations(entity, relation, entityFilter);\n }\n\n function formatContent(entity: T): string {\n return getRelations(entity)\n .map(r => humanizeEntityRef(r, { defaultKind }))\n .join(', ');\n }\n\n return {\n title,\n customFilterAndSearch(filter, entity) {\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => {\n return (\n <EntityRefLinks\n entityRefs={getRelations(entity)}\n defaultKind={defaultKind}\n />\n );\n },\n };\n },\n createOwnerColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'Owner',\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n createDomainColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'Domain',\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: {\n kind: 'domain',\n },\n });\n },\n createSystemColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'System',\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: {\n kind: 'system',\n },\n });\n },\n createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Description',\n field: 'metadata.description',\n render: entity => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n line={2}\n />\n ),\n width: 'auto',\n };\n },\n createSpecLifecycleColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Lifecycle',\n field: 'spec.lifecycle',\n };\n },\n createSpecTypeColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Type',\n field: 'spec.type',\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 { ComponentEntity, SystemEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createDomainColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\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 { Entity } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core';\nimport React, { ReactNode } from 'react';\nimport { columnFactories } from './columns';\nimport { componentEntityColumns, systemEntityColumns } from './presets';\nimport {\n InfoCardVariants,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTable}.\n *\n * @public\n */\nexport interface EntityTableProps<T extends Entity> {\n title: string;\n variant?: InfoCardVariants;\n entities: T[];\n emptyContent?: ReactNode;\n columns: TableColumn<T>[];\n}\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\n/**\n * A general entity table component, that can be used for composing more\n * specific entity tables.\n *\n * @public\n */\nexport const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {\n const {\n entities,\n title,\n emptyContent,\n variant = 'gridItem',\n columns,\n } = props;\n\n const classes = useStyles();\n const tableStyle: React.CSSProperties = {\n minWidth: '0',\n width: '100%',\n };\n\n if (variant === 'gridItem') {\n tableStyle.height = 'calc(100% - 10px)';\n }\n\n return (\n <Table<T>\n columns={columns}\n title={title}\n style={tableStyle}\n emptyContent={\n emptyContent && <div className={classes.empty}>{emptyContent}</div>\n }\n options={{\n // TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;\n search: false,\n paging: false,\n actionsColumnIndex: -1,\n padding: 'dense',\n }}\n data={entities}\n />\n );\n};\n\nEntityTable.columns = columnFactories;\n\nEntityTable.systemEntityColumns = systemEntityColumns;\n\nEntityTable.componentEntityColumns = componentEntityColumns;\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 Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityTagFilter } from '../../filters';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../api';\n\n/** @public */\nexport type CatalogReactEntityTagPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityTagPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityTagPicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n filters,\n queryParameters: { tags: tagsParameter },\n } = useEntityList();\n\n const catalogApi = useApi(catalogApiRef);\n const { value: availableTags } = useAsync(async () => {\n const facet = 'metadata.tags';\n const { facets } = await catalogApi.getEntityFacets({\n facets: [facet],\n filter: filters.kind?.getCatalogFilters(),\n });\n\n return facets[facet].map(({ value }) => value);\n }, [filters.kind]);\n\n const queryParamTags = useMemo(\n () => [tagsParameter].flat().filter(Boolean) as string[],\n [tagsParameter],\n );\n\n const [selectedTags, setSelectedTags] = useState(\n queryParamTags.length ? queryParamTags : filters.tags?.values ?? [],\n );\n\n // Set selected tags on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamTags.length) {\n setSelectedTags(queryParamTags);\n }\n }, [queryParamTags]);\n\n useEffect(() => {\n updateFilters({\n tags: selectedTags.length ? new EntityTagFilter(selectedTags) : undefined,\n });\n }, [selectedTags, updateFilters]);\n\n if (!availableTags?.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Tags</Typography>\n <Autocomplete\n multiple\n aria-label=\"Tags\"\n options={availableTags}\n value={selectedTags}\n onChange={(_: object, value: string[]) => setSelectedTags(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"tag-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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, { useEffect } from 'react';\nimport capitalize from 'lodash/capitalize';\nimport { Box } from '@material-ui/core';\nimport { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter';\n\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Select } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTypePicker}.\n *\n * @public\n */\nexport interface EntityTypePickerProps {\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityTypePicker = (props: EntityTypePickerProps) => {\n const { hidden, initialFilter } = props;\n const alertApi = useApi(alertApiRef);\n const { error, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity types`,\n severity: 'error',\n });\n }\n if (initialFilter) {\n setSelectedTypes([initialFilter]);\n }\n }, [error, alertApi, initialFilter, setSelectedTypes]);\n\n if (availableTypes.length === 0 || error) return null;\n\n const items = [\n { value: 'all', label: 'All' },\n ...availableTypes.map((type: string) => ({\n value: type,\n label: capitalize(type),\n })),\n ];\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Type\"\n items={items}\n selected={(items.length > 1 ? selectedTypes[0] : undefined) ?? 'all'}\n onChange={value =>\n setSelectedTypes(value === 'all' ? [] : [String(value)])\n }\n />\n </Box>\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 { Entity } from '@backstage/catalog-model';\nimport { IconButton, Tooltip, withStyles } from '@material-ui/core';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n return (\n <IconButton\n aria-label=\"favorite\"\n color=\"inherit\"\n {...props}\n onClick={() => toggleStarredEntity()}\n >\n <Tooltip\n title={isStarredEntity ? 'Remove from favorites' : 'Add to favorites'}\n >\n {isStarredEntity ? <YellowStar /> : <StarBorder />}\n </Tooltip>\n </IconButton>\n );\n};\n","/*\n * Copyright 2022 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 { parseEntityRef } from '@backstage/catalog-model';\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nconst DEFAULT_ICON = WorkIcon;\n\nfunction getKind(\n kind: string | undefined,\n entityRef: string | undefined,\n): string | undefined {\n if (kind) {\n return kind.toLocaleLowerCase('en-US');\n }\n\n if (entityRef) {\n try {\n return parseEntityRef(entityRef).kind.toLocaleLowerCase('en-US');\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\nfunction useIcon(kind: string | undefined, entityRef: string | undefined) {\n const app = useApp();\n\n const actualKind = getKind(kind, entityRef);\n if (!actualKind) {\n return DEFAULT_ICON;\n }\n\n const icon = app.getSystemIcon(`kind:${actualKind}`);\n return icon || DEFAULT_ICON;\n}\n\nexport function EntityKindIcon(props: {\n kind?: string;\n entityRef?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const { kind, entityRef, ...otherProps } = props;\n const Icon = useIcon(kind, entityRef);\n return <Icon {...otherProps} />;\n}\n","/*\n * Copyright 2022 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 Entity,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { Box, DialogContentText, makeStyles } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { humanizeEntityRef } from '../../EntityRefLink';\nimport { entityRouteRef } from '../../../routes';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles(theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\ntype NodeType = Entity & { root: boolean };\n\nfunction useAncestry(root: Entity): {\n loading: boolean;\n error?: Error;\n nodes: DependencyGraphTypes.DependencyNode<NodeType>[];\n edges: DependencyGraphTypes.DependencyEdge[];\n} {\n const catalogClient = useApi(catalogApiRef);\n const entityRef = stringifyEntityRef(root);\n\n const { loading, error, value } = useAsync(async () => {\n const response = await catalogClient.getEntityAncestors({ entityRef });\n const nodes = new Array<DependencyGraphTypes.DependencyNode<NodeType>>();\n const edges = new Array<DependencyGraphTypes.DependencyEdge>();\n for (const current of response.items) {\n const currentRef = stringifyEntityRef(current.entity);\n const isRootNode = currentRef === response.rootEntityRef;\n nodes.push({ id: currentRef, root: isRootNode, ...current.entity });\n for (const parentRef of current.parentEntityRefs) {\n edges.push({ from: currentRef, to: parentRef });\n }\n }\n return { nodes, edges };\n }, [entityRef]);\n\n return {\n loading,\n error,\n nodes: value?.nodes || [],\n edges: value?.edges || [],\n };\n}\n\nfunction CustomNode({ node }: DependencyGraphTypes.RenderNodeProps<NodeType>) {\n const classes = useStyles();\n const navigate = useNavigate();\n const entityRoute = useRouteRef(entityRouteRef);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = iconSize + padding;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n node.metadata.title ||\n (node.kind && node.metadata.name && node.metadata.namespace\n ? humanizeEntityRef({\n kind: node.kind,\n name: node.metadata.name,\n namespace: node.metadata.namespace || '',\n })\n : node.id);\n\n const onClick = () => {\n navigate(\n entityRoute({\n kind: node.kind,\n namespace: node.metadata.namespace || DEFAULT_NAMESPACE,\n name: node.metadata.name,\n }),\n );\n };\n\n return (\n <g onClick={onClick} className={classes.clickable}>\n <rect\n className={classNames(\n classes.node,\n node.root ? 'secondary' : 'primary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n <EntityKindIcon\n kind={node.kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n />\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n\nexport function AncestryPage(props: { entity: Entity }) {\n const { loading, error, nodes, edges } = useAncestry(props.entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <>\n <DialogContentText variant=\"h2\">Ancestry</DialogContentText>\n <DialogContentText gutterBottom>\n This is the ancestry of entities above the current one - as in, the\n chain(s) of entities down to the current one, where{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/life-of-an-entity\">\n processors emitted\n </Link>{' '}\n child entities that ultimately led to the current one existing. Note\n that this is a completely different mechanism from relations.\n </DialogContentText>\n <Box mt={4}>\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={CustomNode}\n direction={DependencyGraphTypes.Direction.BOTTOM_TOP}\n zoom=\"enable-on-click\"\n />\n </Box>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { Link } from '@backstage/core-components';\nimport {\n Box,\n Card,\n CardContent,\n ListItem,\n ListItemIcon,\n ListItemText as MuiListItemText,\n ListSubheader as MuiListSubheader,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n marginTop: {\n marginTop: theme.spacing(2),\n },\n helpIcon: {\n marginLeft: theme.spacing(1),\n color: theme.palette.text.disabled,\n },\n monospace: {\n fontFamily: 'monospace',\n },\n}));\n\nexport function ListItemText(props: {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n}) {\n const classes = useStyles();\n return (\n <MuiListItemText\n {...props}\n primaryTypographyProps={{ className: classes.monospace }}\n secondaryTypographyProps={{ className: classes.monospace }}\n />\n );\n}\n\nexport function ListSubheader(props: { children?: React.ReactNode }) {\n const classes = useStyles();\n return (\n <MuiListSubheader className={classes.monospace}>\n {props.children}\n </MuiListSubheader>\n );\n}\n\nexport function Container(props: {\n title: React.ReactNode;\n helpLink?: string;\n children: React.ReactNode;\n}) {\n return (\n <Box mt={2}>\n <Card variant=\"outlined\">\n <CardContent>\n <Typography variant=\"h6\" gutterBottom>\n {props.title}\n {props.helpLink && <HelpIcon to={props.helpLink} />}\n </Typography>\n {props.children}\n </CardContent>\n </Card>\n </Box>\n );\n}\n\nexport function KeyValueListItem(props: {\n indent?: boolean;\n entry: [string, string];\n}) {\n const [key, value] = props.entry;\n return (\n <ListItem>\n {props.indent && <ListItemIcon />}\n <ListItemText\n primary={key}\n secondary={\n !value.match(/^url:https?:\\/\\//) ? (\n value\n ) : (\n <>\n {value.substring(0, 4)}\n <Link to={value.substring(4)}>{value.substring(4)}</Link>\n </>\n )\n }\n />\n </ListItem>\n );\n}\n\nexport function HelpIcon(props: { to: string }) {\n const classes = useStyles();\n return (\n <Link to={props.to} className={classes.helpIcon}>\n <HelpOutlineIcon fontSize=\"inherit\" />\n </Link>\n );\n}\n","/*\n * Copyright 2022 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 Entity,\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n DialogContentText,\n List,\n ListItem,\n ListItemIcon,\n makeStyles,\n} from '@material-ui/core';\nimport { Alert } from '@material-ui/lab';\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { KeyValueListItem, ListItemText } from './common';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nfunction useColocated(entity: Entity): {\n loading: boolean;\n error?: Error;\n location?: string;\n originLocation?: string;\n colocatedEntities?: Entity[];\n} {\n const catalogApi = useApi(catalogApiRef);\n const currentEntityRef = stringifyEntityRef(entity);\n const location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n const origin = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n\n const { loading, error, value } = useAsync(async () => {\n if (!location && !origin) {\n return [];\n }\n const response = await catalogApi.getEntities({\n filter: [\n ...(location\n ? [{ [`metadata.annotations.${ANNOTATION_LOCATION}`]: location }]\n : []),\n ...(origin\n ? [{ [`metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`]: origin }]\n : []),\n ],\n });\n return response.items;\n }, [location, origin]);\n\n return {\n loading,\n error,\n location,\n originLocation: origin,\n colocatedEntities: value?.filter(\n colocated => stringifyEntityRef(colocated) !== currentEntityRef,\n ),\n };\n}\n\nfunction EntityList(props: { entities: Entity[]; header?: [string, string] }) {\n return (\n <List dense>\n {props.header && <KeyValueListItem key=\"header\" entry={props.header} />}\n {props.entities.map(entity => (\n <ListItem key={stringifyEntityRef(entity)}>\n <ListItemIcon>\n <EntityKindIcon kind={entity.kind} />\n </ListItemIcon>\n <ListItemText primary={<EntityRefLink entityRef={entity} />} />\n </ListItem>\n ))}\n </List>\n );\n}\n\nfunction Contents(props: { entity: Entity }) {\n const { entity } = props;\n\n const { loading, error, location, originLocation, colocatedEntities } =\n useColocated(entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!location && !originLocation) {\n return (\n <Alert severity=\"warning\">Entity had no location information.</Alert>\n );\n } else if (!colocatedEntities?.length) {\n return (\n <Alert severity=\"info\">\n There were no other entities on this location.\n </Alert>\n );\n }\n\n if (location === originLocation) {\n return <EntityList entities={colocatedEntities} />;\n }\n\n const atLocation = colocatedEntities.filter(\n e => e.metadata.annotations?.[ANNOTATION_LOCATION] === location,\n );\n const atOrigin = colocatedEntities.filter(\n e =>\n e.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION] === originLocation,\n );\n\n return (\n <>\n {atLocation.length > 0 && (\n <EntityList\n entities={atLocation}\n header={['At the same location', location!]}\n />\n )}\n {atOrigin.length > 0 && (\n <EntityList\n entities={atOrigin}\n header={['At the same origin', originLocation!]}\n />\n )}\n </>\n );\n}\n\nexport function ColocatedPage(props: { entity: Entity }) {\n const classes = useStyles();\n return (\n <>\n <DialogContentText variant=\"h2\">Colocated</DialogContentText>\n <DialogContentText>\n These are the entities that are colocated with this entity - as in, they\n originated from the same data source (e.g. came from the same YAML\n file), or from the same origin (e.g. the originally registered URL).\n </DialogContentText>\n <div className={classes.root}>\n <Contents entity={props.entity} />\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { JsonObject } from '@backstage/types';\n\nexport function sortKeys(data: JsonObject): JsonObject {\n // we could do something custom, but lexicographical sorting is actually a\n // good choice at least for the default set of keys\n return Object.fromEntries(\n [...Object.entries(data)].sort((a, b) => (a[0] < b[0] ? -1 : 1)),\n );\n}\n","/*\n * Copyright 2022 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 { CodeSnippet } from '@backstage/core-components';\nimport { DialogContentText } from '@material-ui/core';\nimport React from 'react';\nimport { sortKeys } from './util';\n\nexport function JsonPage(props: { entity: Entity }) {\n return (\n <>\n <DialogContentText variant=\"h2\">Entity as JSON</DialogContentText>\n <DialogContentText>\n This is the raw entity data as received from the catalog, on JSON form.\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={JSON.stringify(sortKeys(props.entity), undefined, 2)}\n language=\"json\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { AlphaEntity } from '@backstage/catalog-model';\nimport {\n Box,\n DialogContentText,\n List,\n ListItem,\n ListItemIcon,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport React from 'react';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport {\n Container,\n HelpIcon,\n KeyValueListItem,\n ListItemText,\n ListSubheader,\n} from './common';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nexport function OverviewPage(props: { entity: AlphaEntity }) {\n const classes = useStyles();\n const {\n apiVersion,\n kind,\n metadata,\n spec,\n relations = [],\n status = {},\n } = props.entity;\n\n const groupedRelations = groupBy(\n sortBy(relations, r => r.targetRef),\n 'type',\n );\n\n return (\n <>\n <DialogContentText variant=\"h2\">Overview</DialogContentText>\n <div className={classes.root}>\n <Container title=\"Identity\">\n <List dense>\n <ListItem>\n <ListItemText primary=\"apiVersion\" secondary={apiVersion} />\n </ListItem>\n <ListItem>\n <ListItemText primary=\"kind\" secondary={kind} />\n </ListItem>\n {spec?.type && (\n <ListItem>\n <ListItemText primary=\"spec.type\" secondary={spec.type} />\n </ListItem>\n )}\n {metadata.uid && (\n <ListItem>\n <ListItemText primary=\"uid\" secondary={metadata.uid} />\n </ListItem>\n )}\n {metadata.etag && (\n <ListItem>\n <ListItemText primary=\"etag\" secondary={metadata.etag} />\n </ListItem>\n )}\n </List>\n </Container>\n\n <Container title=\"Metadata\">\n {!!Object.keys(metadata.annotations || {}).length && (\n <List\n dense\n subheader={\n <ListSubheader>\n Annotations\n <HelpIcon to=\"https://backstage.io/docs/features/software-catalog/well-known-annotations\" />\n </ListSubheader>\n }\n >\n {Object.entries(metadata.annotations!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!Object.keys(metadata.labels || {}).length && (\n <List dense subheader={<ListSubheader>Labels</ListSubheader>}>\n {Object.entries(metadata.labels!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!metadata.tags?.length && (\n <List dense subheader={<ListSubheader>Tags</ListSubheader>}>\n {metadata.tags.map((tag, index) => (\n <ListItem key={`${tag}-${index}`}>\n <ListItemIcon />\n <ListItemText primary={tag} />\n </ListItem>\n ))}\n </List>\n )}\n </Container>\n\n {!!relations.length && (\n <Container\n title=\"Relations\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-relations\"\n >\n {Object.entries(groupedRelations).map(\n ([type, groupRelations], index) => (\n <div key={index}>\n <List dense subheader={<ListSubheader>{type}</ListSubheader>}>\n {groupRelations.map(group => (\n <ListItem key={group.targetRef}>\n <ListItemIcon>\n <EntityKindIcon entityRef={group.targetRef} />\n </ListItemIcon>\n <ListItemText\n primary={\n <EntityRefLink entityRef={group.targetRef} />\n }\n />\n </ListItem>\n ))}\n </List>\n </div>\n ),\n )}\n </Container>\n )}\n\n {!!status.items?.length && (\n <Container\n title=\"Status\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-statuses\"\n >\n {status.items.map((item, index) => (\n <div key={index}>\n <Typography>\n {item.level}: {item.type}\n </Typography>\n <Box ml={2}>{item.message}</Box>\n </div>\n ))}\n </Container>\n )}\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { CodeSnippet } from '@backstage/core-components';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport React from 'react';\nimport YAML from 'yaml';\nimport { sortKeys } from './util';\n\nexport function YamlPage(props: { entity: Entity }) {\n return (\n <>\n <DialogContentText variant=\"h2\">Entity as YAML</DialogContentText>\n <DialogContentText>\n This is the raw entity data as received from the catalog, on YAML form.\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={YAML.stringify(sortKeys(props.entity))}\n language=\"yaml\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\n * Copyright 2022 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 Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n makeStyles,\n Tab,\n Tabs,\n} from '@material-ui/core';\nimport React, { useEffect } from 'react';\nimport { AncestryPage } from './components/AncestryPage';\nimport { ColocatedPage } from './components/ColocatedPage';\nimport { JsonPage } from './components/JsonPage';\nimport { OverviewPage } from './components/OverviewPage';\nimport { YamlPage } from './components/YamlPage';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n backgroundColor: theme.palette.background.paper,\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n}));\n\nfunction TabPanel(props: {\n children?: React.ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the low level details of their entities.\n *\n * @public\n */\nexport function InspectEntityDialog(props: {\n open: boolean;\n entity: Entity;\n onClose: () => void;\n}) {\n const classes = useStyles();\n const [activeTab, setActiveTab] = React.useState(0);\n\n useEffect(() => {\n setActiveTab(0);\n }, [props.open]);\n\n if (!props.entity) {\n return null;\n }\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={props.open}\n onClose={props.onClose}\n aria-labelledby=\"entity-inspector-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"entity-inspector-dialog-title\">\n Entity Inspector\n </DialogTitle>\n <DialogContent dividers>\n <div className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label=\"Inspector options\"\n className={classes.tabs}\n >\n <Tab label=\"Overview\" {...a11yProps(0)} />\n <Tab label=\"Ancestry\" {...a11yProps(1)} />\n <Tab label=\"Colocated\" {...a11yProps(2)} />\n <Tab label=\"Raw JSON\" {...a11yProps(3)} />\n <Tab label=\"Raw YAML\" {...a11yProps(4)} />\n </Tabs>\n\n <TabPanel value={activeTab} index={0}>\n <OverviewPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={1}>\n <AncestryPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={2}>\n <ColocatedPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={3}>\n <JsonPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={4}>\n <YamlPage entity={props.entity} />\n </TabPanel>\n </div>\n </DialogContent>\n <DialogActions>\n <Button onClick={props.onClose} color=\"primary\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\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 Entity,\n CompoundEntityRef,\n getCompoundEntityRef,\n ANNOTATION_ORIGIN_LOCATION,\n} from '@backstage/catalog-model';\nimport { catalogApiRef } from '../../api';\nimport { useCallback } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * Each distinct state that the dialog can be in at any given time.\n */\nexport type UseUnregisterEntityDialogState =\n | {\n type: 'loading';\n }\n | {\n type: 'error';\n error: Error;\n }\n | {\n type: 'bootstrap';\n location: string;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'unregister';\n location: string;\n colocatedEntities: CompoundEntityRef[];\n unregisterLocation: () => Promise<void>;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'only-delete';\n deleteEntity: () => Promise<void>;\n };\n\n/**\n * Houses the main logic for unregistering entities and their locations.\n */\nexport function useUnregisterEntityDialogState(\n entity: Entity,\n): UseUnregisterEntityDialogState {\n const catalogApi = useApi(catalogApiRef);\n const locationRef = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n const uid = entity.metadata.uid;\n const isBootstrap = locationRef === 'bootstrap:bootstrap';\n\n // Load the prerequisite data: what entities that are colocated with us, and\n // what location that spawned us\n const prerequisites = useAsync(async () => {\n const locationPromise = catalogApi.getLocationByRef(locationRef!);\n\n let colocatedEntitiesPromise: Promise<Entity[]>;\n if (!locationRef) {\n colocatedEntitiesPromise = Promise.resolve([]);\n } else {\n const locationAnnotationFilter = `metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`;\n colocatedEntitiesPromise = catalogApi\n .getEntities({\n filter: { [locationAnnotationFilter]: locationRef },\n fields: [\n 'kind',\n 'metadata.uid',\n 'metadata.name',\n 'metadata.namespace',\n ],\n })\n .then(response => response.items);\n }\n\n return Promise.all([locationPromise, colocatedEntitiesPromise]).then(\n ([location, colocatedEntities]) => ({\n location,\n colocatedEntities,\n }),\n );\n }, [catalogApi, entity]);\n\n // Unregisters the underlying location which will remove all of the entities that are spawned from\n // it. Can only ever be called when the prerequisites have finished loading successfully, and if\n // there was a matching location.\n const unregisterLocation = useCallback(\n async function unregisterLocationFn() {\n const { location } = prerequisites.value!;\n await catalogApi.removeLocationById(location!.id);\n },\n [catalogApi, prerequisites],\n );\n\n // Just removes the entity, without affecting locations in any way.\n const deleteEntity = useCallback(\n async function deleteEntityFn() {\n await catalogApi.removeEntityByUid(uid!);\n },\n [catalogApi, uid],\n );\n\n // If this is a bootstrap location entity, don't even block on loading\n // prerequisites. We know that all that we will do is to offer to remove the\n // entity, and that doesn't require anything from the prerequisites.\n if (isBootstrap) {\n return { type: 'bootstrap', location: locationRef!, deleteEntity };\n }\n\n // Return early if prerequisites still loading or failing\n const { loading, error, value } = prerequisites;\n if (loading) {\n return { type: 'loading' };\n } else if (error) {\n return { type: 'error', error };\n }\n\n const { location, colocatedEntities } = value!;\n if (!location) {\n return { type: 'only-delete', deleteEntity };\n }\n return {\n type: 'unregister',\n location: locationRef!,\n colocatedEntities: colocatedEntities.map(getCompoundEntityRef),\n unregisterLocation,\n deleteEntity,\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 { Entity } from '@backstage/catalog-model';\nimport { EntityRefLink } from '../EntityRefLink';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Divider,\n makeStyles,\n} from '@material-ui/core';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useCallback, useState } from 'react';\nimport { useUnregisterEntityDialogState } from './useUnregisterEntityDialogState';\n\nimport { alertApiRef, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { assertError } from '@backstage/errors';\n\nconst useStyles = makeStyles({\n advancedButton: {\n fontSize: '0.7em',\n },\n});\n\nconst Contents = ({\n entity,\n onConfirm,\n}: {\n entity: Entity;\n onConfirm: () => any;\n}) => {\n const alertApi = useApi(alertApiRef);\n const configApi = useApi(configApiRef);\n const classes = useStyles();\n const state = useUnregisterEntityDialogState(entity);\n const [showDelete, setShowDelete] = useState(false);\n const [busy, setBusy] = useState(false);\n const appTitle = configApi.getOptionalString('app.title') ?? 'Backstage';\n\n const onUnregister = useCallback(\n async function onUnregisterFn() {\n if ('unregisterLocation' in state) {\n setBusy(true);\n try {\n await state.unregisterLocation();\n onConfirm();\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state],\n );\n\n const onDelete = useCallback(\n async function onDeleteFn() {\n if ('deleteEntity' in state) {\n setBusy(true);\n try {\n await state.deleteEntity();\n onConfirm();\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state],\n );\n\n if (state.type === 'loading') {\n return <Progress />;\n }\n\n if (state.type === 'error') {\n return <ResponseErrorPanel error={state.error} />;\n }\n\n if (state.type === 'bootstrap') {\n return (\n <>\n <Alert severity=\"info\">\n You cannot unregister this entity, since it originates from a\n protected Backstage configuration (location \"{state.location}\"). If\n you believe this is in error, please contact the {appTitle}{' '}\n integrator.\n </Alert>\n\n <Box marginTop={2}>\n {!showDelete && (\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n Advanced Options\n </Button>\n )}\n\n {showDelete && (\n <>\n <DialogContentText>\n You have the option to delete the entity itself from the\n catalog. Note that this should only be done if you know that the\n catalog file has been deleted at, or moved from, its origin\n location. If that is not the case, the entity will reappear\n shortly as the next refresh round is performed by the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n )}\n </Box>\n </>\n );\n }\n\n if (state.type === 'only-delete') {\n return (\n <>\n <DialogContentText>\n This entity does not seem to originate from a registered location. You\n therefore only have the option to delete it outright from the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n );\n }\n\n if (state.type === 'unregister') {\n return (\n <>\n <DialogContentText>\n This action will unregister the following entities:\n </DialogContentText>\n <DialogContentText component=\"ul\">\n {state.colocatedEntities.map(e => (\n <li key={`${e.kind}:${e.namespace}/${e.name}`}>\n <EntityRefLink entityRef={e} />\n </li>\n ))}\n </DialogContentText>\n <DialogContentText>\n Located at the following location:\n </DialogContentText>\n <DialogContentText component=\"ul\">\n <li>{state.location}</li>\n </DialogContentText>\n <DialogContentText>\n To undo, just re-register the entity in {appTitle}.\n </DialogContentText>\n <Box marginTop={2}>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onUnregister}\n >\n Unregister Location\n </Button>\n {!showDelete && (\n <Box component=\"span\" marginLeft={2}>\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n Advanced Options\n </Button>\n </Box>\n )}\n </Box>\n\n {showDelete && (\n <>\n <Box paddingTop={4} paddingBottom={4}>\n <Divider />\n </Box>\n <DialogContentText>\n You also have the option to delete the entity itself from the\n catalog. Note that this should only be done if you know that the\n catalog file has been deleted at, or moved from, its origin\n location. If that is not the case, the entity will reappear\n shortly as the next refresh round is performed by the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n )}\n </>\n );\n }\n\n return <Alert severity=\"error\">Internal error: Unknown state</Alert>;\n};\n\n/** @public */\nexport type UnregisterEntityDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onClose: () => any;\n entity: Entity;\n};\n\n/** @public */\nexport const UnregisterEntityDialog = (props: UnregisterEntityDialogProps) => {\n const { open, onConfirm, onClose, entity } = props;\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle id=\"responsive-dialog-title\">\n Are you sure you want to unregister this entity?\n </DialogTitle>\n <DialogContent>\n <Contents entity={entity} onConfirm={onConfirm} />\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\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 configApiRef,\n IconComponent,\n useApi,\n} from '@backstage/core-plugin-api';\nimport {\n Card,\n List,\n ListItemIcon,\n ListItemSecondaryAction,\n ListItemText,\n makeStyles,\n MenuItem,\n Theme,\n Typography,\n} from '@material-ui/core';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport StarIcon from '@material-ui/icons/Star';\nimport { compact } from 'lodash';\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\nimport { UserListFilter } from '../../filters';\nimport {\n useEntityList,\n useStarredEntities,\n useEntityOwnership,\n} from '../../hooks';\nimport { UserListFilterKind } from '../../types';\nimport { reduceEntityFilters } from '../../utils';\n\n/** @public */\nexport type CatalogReactUserListPickerClassKey =\n | 'root'\n | 'title'\n | 'listIcon'\n | 'menuItem'\n | 'groupWrapper';\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n root: {\n backgroundColor: 'rgba(0, 0, 0, .11)',\n boxShadow: 'none',\n margin: theme.spacing(1, 0, 1, 0),\n },\n title: {\n margin: theme.spacing(1, 0, 0, 1),\n textTransform: 'uppercase',\n fontSize: 12,\n fontWeight: 'bold',\n },\n listIcon: {\n minWidth: 30,\n color: theme.palette.text.primary,\n },\n menuItem: {\n minHeight: theme.spacing(6),\n },\n groupWrapper: {\n margin: theme.spacing(1, 1, 2, 1),\n },\n }),\n {\n name: 'CatalogReactUserListPicker',\n },\n);\n\nexport type ButtonGroup = {\n name: string;\n items: {\n id: 'owned' | 'starred' | 'all';\n label: string;\n icon?: IconComponent;\n }[];\n};\n\nfunction getFilterGroups(orgName: string | undefined): ButtonGroup[] {\n return [\n {\n name: 'Personal',\n items: [\n {\n id: 'owned',\n label: 'Owned',\n icon: SettingsIcon,\n },\n {\n id: 'starred',\n label: 'Starred',\n icon: StarIcon,\n },\n ],\n },\n {\n name: orgName ?? 'Company',\n items: [\n {\n id: 'all',\n label: 'All',\n },\n ],\n },\n ];\n}\n\n/** @public */\nexport type UserListPickerProps = {\n initialFilter?: UserListFilterKind;\n availableFilters?: UserListFilterKind[];\n};\n\n/** @public */\nexport const UserListPicker = (props: UserListPickerProps) => {\n const { initialFilter, availableFilters } = props;\n const classes = useStyles();\n const configApi = useApi(configApiRef);\n const orgName = configApi.getOptionalString('organization.name') ?? 'Company';\n const {\n filters,\n updateFilters,\n backendEntities,\n queryParameters: { kind: kindParameter, user: userParameter },\n loading: loadingBackendEntities,\n } = useEntityList();\n\n // Remove group items that aren't in availableFilters and exclude\n // any now-empty groups.\n const userAndGroupFilterIds = ['starred', 'all'];\n const filterGroups = getFilterGroups(orgName)\n .map(filterGroup => ({\n ...filterGroup,\n items: filterGroup.items.filter(({ id }) =>\n // TODO: avoid hardcoding kinds here\n ['group', 'user'].some(kind => kind === kindParameter)\n ? userAndGroupFilterIds.includes(id)\n : !availableFilters || availableFilters.includes(id),\n ),\n }))\n .filter(({ items }) => !!items.length);\n\n const { isStarredEntity } = useStarredEntities();\n const { isOwnedEntity, loading: loadingEntityOwnership } =\n useEntityOwnership();\n\n const loading = loadingBackendEntities || loadingEntityOwnership;\n\n // Static filters; used for generating counts of potentially unselected kinds\n const ownedFilter = useMemo(\n () => new UserListFilter('owned', isOwnedEntity, isStarredEntity),\n [isOwnedEntity, isStarredEntity],\n );\n const starredFilter = useMemo(\n () => new UserListFilter('starred', isOwnedEntity, isStarredEntity),\n [isOwnedEntity, isStarredEntity],\n );\n\n const queryParamUserFilter = useMemo(\n () => [userParameter].flat()[0],\n [userParameter],\n );\n\n const [selectedUserFilter, setSelectedUserFilter] = useState(\n queryParamUserFilter ?? initialFilter,\n );\n\n // To show proper counts for each section, apply all other frontend filters _except_ the user\n // filter that's controlled by this picker.\n const entitiesWithoutUserFilter = useMemo(\n () =>\n backendEntities.filter(\n reduceEntityFilters(\n compact(Object.values({ ...filters, user: undefined })),\n ),\n ),\n [filters, backendEntities],\n );\n\n const filterCounts = useMemo<Record<string, number>>(\n () => ({\n all: entitiesWithoutUserFilter.length,\n starred: entitiesWithoutUserFilter.filter(entity =>\n starredFilter.filterEntity(entity),\n ).length,\n owned: entitiesWithoutUserFilter.filter(entity =>\n ownedFilter.filterEntity(entity),\n ).length,\n }),\n [entitiesWithoutUserFilter, starredFilter, ownedFilter],\n );\n\n // Set selected user filter on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamUserFilter) {\n setSelectedUserFilter(queryParamUserFilter as UserListFilterKind);\n }\n }, [queryParamUserFilter]);\n\n useEffect(() => {\n if (\n !loading &&\n !!selectedUserFilter &&\n selectedUserFilter !== 'all' &&\n filterCounts[selectedUserFilter] === 0\n ) {\n setSelectedUserFilter('all');\n }\n }, [loading, filterCounts, selectedUserFilter, setSelectedUserFilter]);\n\n useEffect(() => {\n updateFilters({\n user: selectedUserFilter\n ? new UserListFilter(\n selectedUserFilter as UserListFilterKind,\n isOwnedEntity,\n isStarredEntity,\n )\n : undefined,\n });\n }, [selectedUserFilter, isOwnedEntity, isStarredEntity, updateFilters]);\n\n return (\n <Card className={classes.root}>\n {filterGroups.map(group => (\n <Fragment key={group.name}>\n <Typography variant=\"subtitle2\" className={classes.title}>\n {group.name}\n </Typography>\n <Card className={classes.groupWrapper}>\n <List disablePadding dense>\n {group.items.map(item => (\n <MenuItem\n key={item.id}\n button\n divider\n onClick={() => setSelectedUserFilter(item.id)}\n selected={item.id === filters.user?.value}\n className={classes.menuItem}\n disabled={filterCounts[item.id] === 0}\n data-testid={`user-picker-${item.id}`}\n >\n {item.icon && (\n <ListItemIcon className={classes.listIcon}>\n <item.icon fontSize=\"small\" />\n </ListItemIcon>\n )}\n <ListItemText>\n <Typography variant=\"body1\">{item.label}</Typography>\n </ListItemText>\n <ListItemSecondaryAction>\n {filterCounts[item.id] ?? '-'}\n </ListItemSecondaryAction>\n </MenuItem>\n ))}\n </List>\n </Card>\n </Fragment>\n ))}\n </Card>\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, {\n PropsWithChildren,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n DefaultEntityFilters,\n EntityListContext,\n EntityListContextProps,\n} from '../hooks/useEntityListProvider';\n\n/** @public */\nexport const MockEntityListContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value?: Partial<EntityListContextProps>;\n}>) => {\n // Provides a default implementation that stores filter state, for testing components that\n // reflect filter state.\n const [filters, setFilters] = useState<DefaultEntityFilters>(\n value?.filters ?? {},\n );\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<DefaultEntityFilters>\n | ((\n prevFilters: DefaultEntityFilters,\n ) => Partial<DefaultEntityFilters>),\n ) => {\n setFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [],\n );\n\n // Memoize the default values since pickers have useEffect triggers on these; naively defaulting\n // below with `?? <X>` breaks referential equality on subsequent updates.\n const defaultValues = useMemo(\n () => ({\n entities: [],\n backendEntities: [],\n queryParameters: {},\n }),\n [],\n );\n\n const resolvedValue: EntityListContextProps = useMemo(\n () => ({\n entities: value?.entities ?? defaultValues.entities,\n backendEntities: value?.backendEntities ?? defaultValues.backendEntities,\n updateFilters: value?.updateFilters ?? updateFilters,\n filters,\n loading: value?.loading ?? false,\n queryParameters: value?.queryParameters ?? defaultValues.queryParameters,\n error: value?.error,\n }),\n [value, defaultValues, filters, updateFilters],\n );\n\n return (\n <EntityListContext.Provider value={resolvedValue}>\n {children}\n </EntityListContext.Provider>\n );\n};\n"],"names":["isEqual","getEntityRef","useStyles","icon","checkedIcon","MuiListItemText","MuiListSubheader","Contents","groupBy","DialogContentText","Alert","StarIcon","ListItemText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACY,MAAC,aAAa,GAAG,YAAY,CAAC;AAC1C,EAAE,EAAE,EAAE,wBAAwB;AAC9B,CAAC;;ACFW,MAAC,qBAAqB,GAAG,YAAY,CAAC;AAClD,EAAE,EAAE,EAAE,gCAAgC;AACtC,CAAC;;ACFM,MAAM,sBAAsB,CAAC;AACpC,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,eAAe,mBAAmB,IAAI,GAAG,EAAE,CAAC;AACrD,IAAI,IAAI,CAAC,WAAW,mBAAmB,IAAI,GAAG,EAAE,CAAC;AACjD,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,cAAc,CAAC,CAAC,UAAU,KAAK;AACzD,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;AACrD,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACvC,MAAM,OAAO,MAAM;AACnB,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,OAAO,CAAC;AACR,KA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AM,eAAe,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,eAAe;AACzH,MAAM,aAAa,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa;AACrG,MAAM,OAAO;AACb,MAAM,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK;AACjF,MAAM,eAAe,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,eAAe;AACzH,MAAM,KAAK,EAAE,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK;AACjD,KAAK,CAAC;AACN,GAAG,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AACrD,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,QAAQ,EAAE;AACzE,IAAI,KAAK,EAAE,aAAa;AACxB,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/api.ts","../src/apis/StarredEntitiesApi/StarredEntitiesApi.ts","../src/apis/StarredEntitiesApi/MockStarredEntitiesApi.ts","../src/components/CatalogFilterLayout/CatalogFilterLayout.tsx","../src/hooks/useEntity.tsx","../src/utils/filters.ts","../src/utils/getEntityRelations.ts","../src/utils/getEntitySourceLocation.ts","../src/utils/isOwnerOf.ts","../src/hooks/useEntityListProvider.tsx","../src/routes.ts","../src/components/EntityRefLink/humanize.ts","../src/components/EntityRefLink/EntityRefLink.tsx","../src/components/EntityRefLink/EntityRefLinks.tsx","../src/filters.ts","../src/hooks/useEntityTypeFilter.tsx","../src/hooks/useRelatedEntities.ts","../src/hooks/useStarredEntities.ts","../src/hooks/useStarredEntity.ts","../src/hooks/useEntityOwnership.ts","../src/hooks/useEntityPermission.ts","../src/components/EntityKindPicker/EntityKindPicker.tsx","../src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx","../src/components/EntityOwnerPicker/EntityOwnerPicker.tsx","../src/components/EntitySearchBar/EntitySearchBar.tsx","../src/components/EntityTable/columns.tsx","../src/components/EntityTable/presets.tsx","../src/components/EntityTable/EntityTable.tsx","../src/components/EntityTagPicker/EntityTagPicker.tsx","../src/components/EntityTypePicker/EntityTypePicker.tsx","../src/components/FavoriteEntity/FavoriteEntity.tsx","../src/components/InspectEntityDialog/components/EntityKindIcon.tsx","../src/components/InspectEntityDialog/components/AncestryPage.tsx","../src/components/InspectEntityDialog/components/common.tsx","../src/components/InspectEntityDialog/components/ColocatedPage.tsx","../src/components/InspectEntityDialog/components/util.ts","../src/components/InspectEntityDialog/components/JsonPage.tsx","../src/components/InspectEntityDialog/components/OverviewPage.tsx","../src/components/InspectEntityDialog/components/YamlPage.tsx","../src/components/InspectEntityDialog/InspectEntityDialog.tsx","../src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts","../src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx","../src/components/UserListPicker/UserListPicker.tsx","../src/testUtils/providers.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 { CatalogApi } from '@backstage/catalog-client';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * The API reference for the {@link @backstage/catalog-client#CatalogApi}.\n * @public\n */\nexport const catalogApiRef = createApiRef<CatalogApi>({\n id: 'plugin.catalog.service',\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 { ApiRef, createApiRef } from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API to store starred entities\n *\n * @public\n */\nexport const starredEntitiesApiRef: ApiRef<StarredEntitiesApi> = createApiRef({\n id: 'catalog-react.starred-entities',\n});\n\n/**\n * An API to store and retrieve starred entities\n *\n * @public\n */\nexport interface StarredEntitiesApi {\n /**\n * Toggle the star state of the entity\n *\n * @param entityRef - an entity reference to toggle\n */\n toggleStarred(entityRef: string): Promise<void>;\n\n /**\n * Observe the set of starred entity references.\n */\n starredEntitie$(): Observable<Set<string>>;\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 { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { StarredEntitiesApi } from './StarredEntitiesApi';\n\n/**\n * An in-memory mock implementation of the StarredEntitiesApi.\n *\n * @public\n */\nexport class MockStarredEntitiesApi implements StarredEntitiesApi {\n private readonly starredEntities = new Set<string>();\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (!this.starredEntities.delete(entityRef)) {\n this.starredEntities.add(entityRef);\n }\n\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\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, { useState } from 'react';\nimport {\n Box,\n Button,\n Drawer,\n Grid,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { BackstageTheme } from '@backstage/theme';\n\n/** @public */\nexport const Filters = (props: { children: React.ReactNode }) => {\n const isMidSizeScreen = useMediaQuery<BackstageTheme>(theme =>\n theme.breakpoints.down('md'),\n );\n const theme = useTheme<BackstageTheme>();\n const [filterDrawerOpen, setFilterDrawerOpen] = useState<boolean>(false);\n\n return isMidSizeScreen ? (\n <>\n <Button\n style={{ marginTop: theme.spacing(1), marginLeft: theme.spacing(1) }}\n onClick={() => setFilterDrawerOpen(true)}\n startIcon={<FilterListIcon />}\n >\n Filters\n </Button>\n <Drawer\n open={filterDrawerOpen}\n onClose={() => setFilterDrawerOpen(false)}\n anchor=\"left\"\n disableAutoFocus\n keepMounted\n variant=\"temporary\"\n >\n <Box m={2}>\n <Typography\n variant=\"h6\"\n component=\"h2\"\n style={{ marginBottom: theme.spacing(1) }}\n >\n Filters\n </Typography>\n {props.children}\n </Box>\n </Drawer>\n </>\n ) : (\n <Grid item lg={2}>\n {props.children}\n </Grid>\n );\n};\n\n/** @public */\nexport const Content = (props: { children: React.ReactNode }) => {\n return (\n <Grid item xs={12} lg={10}>\n {props.children}\n </Grid>\n );\n};\n\n/** @public */\nexport const CatalogFilterLayout = (props: { children: React.ReactNode }) => {\n return (\n <Grid container style={{ position: 'relative' }}>\n {props.children}\n </Grid>\n );\n};\n\nCatalogFilterLayout.Filters = Filters;\nCatalogFilterLayout.Content = Content;\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 */\nimport { Entity } from '@backstage/catalog-model';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport React, { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = ({\n children,\n entity,\n loading,\n error,\n refresh,\n}: AsyncEntityProviderProps) => {\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n {children}\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\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 { Entity } from '@backstage/catalog-model';\nimport { EntityFilter } from '../types';\n\nexport function reduceCatalogFilters(\n filters: EntityFilter[],\n): Record<string, string | symbol | (string | symbol)[]> {\n return filters.reduce((compoundFilter, filter) => {\n return {\n ...compoundFilter,\n ...(filter.getCatalogFilters ? filter.getCatalogFilters() : {}),\n };\n }, {} as Record<string, string | symbol | (string | symbol)[]>);\n}\n\nexport function reduceEntityFilters(\n filters: EntityFilter[],\n): (entity: Entity) => boolean {\n return (entity: Entity) =>\n filters.every(\n filter => !filter.filterEntity || filter.filterEntity(entity),\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 {\n Entity,\n CompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\n// TODO(freben): This should be returning entity refs instead\n/**\n * Get the related entity references.\n *\n * @public\n */\nexport function getEntityRelations(\n entity: Entity | undefined,\n relationType: string,\n filter?: { kind: string },\n): CompoundEntityRef[] {\n let entityNames =\n entity?.relations\n ?.filter(r => r.type === relationType)\n .map(r => parseEntityRef(r.targetRef)) || [];\n\n if (filter?.kind) {\n entityNames = entityNames.filter(\n e =>\n e.kind.toLocaleLowerCase('en-US') ===\n filter.kind.toLocaleLowerCase('en-US'),\n );\n }\n\n return entityNames;\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 {\n ANNOTATION_SOURCE_LOCATION,\n Entity,\n parseLocationRef,\n} from '@backstage/catalog-model';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\n\n/** @public */\nexport type EntitySourceLocation = {\n locationTargetUrl: string;\n integrationType?: string;\n};\n\n/** @public */\nexport function getEntitySourceLocation(\n entity: Entity,\n scmIntegrationsApi: ScmIntegrationRegistry,\n): EntitySourceLocation | undefined {\n const sourceLocation =\n entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];\n\n if (!sourceLocation) {\n return undefined;\n }\n\n try {\n const sourceLocationRef = parseLocationRef(sourceLocation);\n const integration = scmIntegrationsApi.byUrl(sourceLocationRef.target);\n return {\n locationTargetUrl: sourceLocationRef.target,\n integrationType: integration?.type,\n };\n } catch {\n return undefined;\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 {\n Entity,\n getCompoundEntityRef,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { getEntityRelations } from './getEntityRelations';\n\n/**\n * Returns true if the `owner` argument is a direct owner on the `entity` argument.\n *\n * @alpha\n * @remarks\n *\n * Note that this ownership is not the same as using the claims in the auth-resolver, it only will take into account ownership as expressed by direct entity relations.\n * It doesn't know anything about the additional groups that a user might belong to which the claims contain.\n */\nexport function isOwnerOf(owner: Entity, entity: Entity) {\n const possibleOwners = new Set(\n [\n ...getEntityRelations(owner, RELATION_MEMBER_OF, { kind: 'group' }),\n ...(owner ? [getCompoundEntityRef(owner)] : []),\n ].map(stringifyEntityRef),\n );\n\n const owners = getEntityRelations(entity, RELATION_OWNED_BY).map(\n stringifyEntityRef,\n );\n\n for (const ownerItem of owners) {\n if (possibleOwners.has(ownerItem)) {\n return true;\n }\n }\n\n return false;\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 { Entity } from '@backstage/catalog-model';\nimport { compact, isEqual } from 'lodash';\nimport qs from 'qs';\nimport React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport useMountedState from 'react-use/lib/useMountedState';\nimport { catalogApiRef } from '../api';\nimport {\n EntityKindFilter,\n EntityLifecycleFilter,\n EntityOwnerFilter,\n EntityTagFilter,\n EntityTextFilter,\n EntityTypeFilter,\n UserListFilter,\n} from '../filters';\nimport { EntityFilter } from '../types';\nimport { reduceCatalogFilters, reduceEntityFilters } from '../utils';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport type DefaultEntityFilters = {\n kind?: EntityKindFilter;\n type?: EntityTypeFilter;\n user?: UserListFilter;\n owners?: EntityOwnerFilter;\n lifecycles?: EntityLifecycleFilter;\n tags?: EntityTagFilter;\n text?: EntityTextFilter;\n};\n\n/** @public */\nexport type EntityListContextProps<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n> = {\n /**\n * The currently registered filters, adhering to the shape of DefaultEntityFilters or an extension\n * of that default (to add custom filter types).\n */\n filters: EntityFilters;\n\n /**\n * The resolved list of catalog entities, after all filters are applied.\n */\n entities: Entity[];\n\n /**\n * The resolved list of catalog entities, after _only catalog-backend_ filters are applied.\n */\n backendEntities: Entity[];\n\n /**\n * Update one or more of the registered filters. Optional filters can be set to `undefined` to\n * reset the filter.\n */\n updateFilters: (\n filters:\n | Partial<EntityFilters>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => void;\n\n /**\n * Filter values from query parameters.\n */\n queryParameters: Partial<Record<keyof EntityFilters, string | string[]>>;\n\n loading: boolean;\n error?: Error;\n};\n\n/**\n * Creates new context for entity listing and filtering.\n * @public\n */\nexport const EntityListContext = createContext<\n EntityListContextProps<any> | undefined\n>(undefined);\n\ntype OutputState<EntityFilters extends DefaultEntityFilters> = {\n appliedFilters: EntityFilters;\n entities: Entity[];\n backendEntities: Entity[];\n};\n\n/**\n * Provides entities and filters for a catalog listing.\n * @public\n */\nexport const EntityListProvider = <EntityFilters extends DefaultEntityFilters>({\n children,\n}: PropsWithChildren<{}>) => {\n const isMounted = useMountedState();\n const catalogApi = useApi(catalogApiRef);\n const [requestedFilters, setRequestedFilters] = useState<EntityFilters>(\n {} as EntityFilters,\n );\n\n // We use react-router's useLocation hook so updates from external sources trigger an update to\n // the queryParameters in outputState. Updates from this hook use replaceState below and won't\n // trigger a useLocation change; this would instead come from an external source, such as a manual\n // update of the URL or two catalog sidebar links with different catalog filters.\n const location = useLocation();\n const queryParameters = useMemo(\n () =>\n (qs.parse(location.search, {\n ignoreQueryPrefix: true,\n }).filters ?? {}) as Record<string, string | string[]>,\n [location],\n );\n\n const [outputState, setOutputState] = useState<OutputState<EntityFilters>>(\n () => {\n return {\n appliedFilters: {} as EntityFilters,\n entities: [],\n backendEntities: [],\n };\n },\n );\n\n // The main async filter worker. Note that while it has a lot of dependencies\n // in terms of its implementation, the triggering only happens (debounced)\n // based on the requested filters changing.\n const [{ loading, error }, refresh] = useAsyncFn(\n async () => {\n const compacted = compact(Object.values(requestedFilters));\n const entityFilter = reduceEntityFilters(compacted);\n const backendFilter = reduceCatalogFilters(compacted);\n const previousBackendFilter = reduceCatalogFilters(\n compact(Object.values(outputState.appliedFilters)),\n );\n\n const queryParams = Object.keys(requestedFilters).reduce(\n (params, key) => {\n const filter: EntityFilter | undefined =\n requestedFilters[key as keyof EntityFilters];\n if (filter?.toQueryValue) {\n params[key] = filter.toQueryValue();\n }\n return params;\n },\n {} as Record<string, string | string[]>,\n );\n\n // TODO(mtlewis): currently entities will never be requested unless\n // there's at least one filter, we should allow an initial request\n // to happen with no filters.\n if (!isEqual(previousBackendFilter, backendFilter)) {\n // TODO(timbonicus): should limit fields here, but would need filter\n // fields + table columns\n const response = await catalogApi.getEntities({\n filter: backendFilter,\n });\n setOutputState({\n appliedFilters: requestedFilters,\n backendEntities: response.items,\n entities: response.items.filter(entityFilter),\n });\n } else {\n setOutputState({\n appliedFilters: requestedFilters,\n backendEntities: outputState.backendEntities,\n entities: outputState.backendEntities.filter(entityFilter),\n });\n }\n\n if (isMounted()) {\n const oldParams = qs.parse(location.search, {\n ignoreQueryPrefix: true,\n });\n const newParams = qs.stringify(\n { ...oldParams, filters: queryParams },\n { addQueryPrefix: true, arrayFormat: 'repeat' },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing, since we\n // don't want there to be back/forward slots for every single filter\n // change.\n window.history?.replaceState(null, document.title, newUrl);\n }\n },\n [catalogApi, queryParameters, requestedFilters, outputState],\n { loading: true },\n );\n\n // Slight debounce on the refresh, since (especially on page load) several\n // filters will be calling this in rapid succession.\n useDebounce(refresh, 10, [requestedFilters]);\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<EntityFilter>\n | ((prevFilters: EntityFilters) => Partial<EntityFilters>),\n ) => {\n setRequestedFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [],\n );\n\n const value = useMemo(\n () => ({\n filters: outputState.appliedFilters,\n entities: outputState.entities,\n backendEntities: outputState.backendEntities,\n updateFilters,\n queryParameters,\n loading,\n error,\n }),\n [outputState, updateFilters, queryParameters, loading, error],\n );\n\n return (\n <EntityListContext.Provider value={value}>\n {children}\n </EntityListContext.Provider>\n );\n};\n\n/**\n * Hook for interacting with the entity list context provided by the {@link EntityListProvider}.\n * @public\n */\nexport function useEntityList<\n EntityFilters extends DefaultEntityFilters = DefaultEntityFilters,\n>(): EntityListContextProps<EntityFilters> {\n const context = useContext(EntityListContext);\n if (!context)\n throw new Error('useEntityList must be used within EntityListProvider');\n return context;\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 { Entity, DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { createRouteRef } from '@backstage/core-plugin-api';\nimport { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\n/**\n * A stable route ref that points to the catalog page for an individual entity.\n *\n * This `RouteRef` can be imported and used directly, and does not need to be referenced\n * via an `ExternalRouteRef`.\n *\n * If you want to replace the `EntityPage` from `@backstage/catalog-plugin` in your app,\n * you need to use the `entityRouteRef` as the mount point instead of your own.\n * @public\n */\nexport const entityRouteRef = getOrCreateGlobalSingleton(\n 'catalog:entity-route-ref',\n () =>\n createRouteRef({\n id: 'catalog:entity',\n params: ['namespace', 'kind', 'name'],\n }),\n);\n\n/**\n * Utility function to get suitable route params for entityRoute, given an\n * @public\n */\nexport function entityRouteParams(entity: Entity) {\n return {\n kind: entity.kind.toLocaleLowerCase('en-US'),\n namespace:\n entity.metadata.namespace?.toLocaleLowerCase('en-US') ??\n DEFAULT_NAMESPACE,\n name: entity.metadata.name,\n } as const;\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 {\n Entity,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n} from '@backstage/catalog-model';\n\n/** @public */\nexport function humanizeEntityRef(\n entityRef: Entity | CompoundEntityRef,\n opts?: { defaultKind?: string },\n) {\n const defaultKind = opts?.defaultKind;\n let kind;\n let namespace;\n let name;\n\n if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n if (namespace === DEFAULT_NAMESPACE) {\n namespace = undefined;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n kind =\n defaultKind && defaultKind.toLocaleLowerCase('en-US') === kind\n ? undefined\n : kind;\n return `${kind ? `${kind}:` : ''}${namespace ? `${namespace}/` : ''}${name}`;\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 {\n Entity,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport React, { forwardRef } from 'react';\nimport { entityRouteRef } from '../../routes';\nimport { humanizeEntityRef } from './humanize';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { Tooltip } from '@material-ui/core';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n title?: string;\n children?: React.ReactNode;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const { entityRef, defaultKind, title, children, ...linkProps } = props;\n const entityRoute = useRouteRef(entityRouteRef);\n\n let kind;\n let namespace;\n let name;\n\n if (typeof entityRef === 'string') {\n const parsed = parseEntityRef(entityRef);\n kind = parsed.kind;\n namespace = parsed.namespace;\n name = parsed.name;\n } else if ('metadata' in entityRef) {\n kind = entityRef.kind;\n namespace = entityRef.metadata.namespace;\n name = entityRef.metadata.name;\n } else {\n kind = entityRef.kind;\n namespace = entityRef.namespace;\n name = entityRef.name;\n }\n\n kind = kind.toLocaleLowerCase('en-US');\n namespace = namespace?.toLocaleLowerCase('en-US') ?? DEFAULT_NAMESPACE;\n\n const routeParams = { kind, namespace, name };\n const formattedEntityRefTitle = humanizeEntityRef(\n { kind, namespace, name },\n { defaultKind },\n );\n\n const link = (\n <Link {...linkProps} ref={ref} to={entityRoute(routeParams)}>\n {children}\n {!children && (title ?? formattedEntityRefTitle)}\n </Link>\n );\n\n return title ? (\n <Tooltip title={formattedEntityRefTitle}>{link}</Tooltip>\n ) : (\n link\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\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 { Entity, CompoundEntityRef } from '@backstage/catalog-model';\nimport React from 'react';\nimport { EntityRefLink } from './EntityRefLink';\nimport { LinkProps } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinksProps = {\n entityRefs: (string | Entity | CompoundEntityRef)[];\n defaultKind?: string;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a list of clickable links to entities.\n *\n * @public\n */\nexport function EntityRefLinks(props: EntityRefLinksProps) {\n const { entityRefs, defaultKind, ...linkProps } = props;\n return (\n <>\n {entityRefs.map((r, i) => (\n <React.Fragment key={i}>\n {i > 0 && ', '}\n <EntityRefLink\n {...linkProps}\n entityRef={r}\n defaultKind={defaultKind}\n />\n </React.Fragment>\n ))}\n </>\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 { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { humanizeEntityRef } from './components/EntityRefLink';\nimport { EntityFilter, UserListFilterKind } from './types';\nimport { getEntityRelations } from './utils';\n\n/**\n * Filter entities based on Kind.\n * @public\n */\nexport class EntityKindFilter implements EntityFilter {\n constructor(readonly value: string) {}\n\n getCatalogFilters(): Record<string, string | string[]> {\n return { kind: this.value };\n }\n\n toQueryValue(): string {\n return this.value;\n }\n}\n\n/**\n * Filters entities based on type\n * @public\n */\nexport class EntityTypeFilter implements EntityFilter {\n constructor(readonly value: string | string[]) {}\n\n // Simplify `string | string[]` for consumers, always returns an array\n getTypes(): string[] {\n return Array.isArray(this.value) ? this.value : [this.value];\n }\n\n getCatalogFilters(): Record<string, string | string[]> {\n return { 'spec.type': this.getTypes() };\n }\n\n toQueryValue(): string[] {\n return this.getTypes();\n }\n}\n\n/**\n * Filters entities based on tag.\n * @public\n */\nexport class EntityTagFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.every(v => (entity.metadata.tags ?? []).includes(v));\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities where the text matches spec, title or tags.\n * @public\n */\nexport class EntityTextFilter implements EntityFilter {\n constructor(readonly value: string) {}\n\n filterEntity(entity: Entity): boolean {\n const upperCaseValue = this.value.toLocaleUpperCase('en-US');\n\n return (\n entity.metadata.name\n .toLocaleUpperCase('en-US')\n .includes(upperCaseValue) ||\n `${entity.metadata.title}`\n .toLocaleUpperCase('en-US')\n .includes(upperCaseValue) ||\n entity.metadata.tags\n ?.join('')\n .toLocaleUpperCase('en-US')\n .indexOf(upperCaseValue) !== -1\n );\n }\n}\n\n/**\n * Filter matching entities that are owned by group.\n * @public\n */\nexport class EntityOwnerFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.some(v =>\n getEntityRelations(entity, RELATION_OWNED_BY).some(\n o => humanizeEntityRef(o, { defaultKind: 'group' }) === v,\n ),\n );\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities on lifecycle.\n * @public\n */\nexport class EntityLifecycleFilter implements EntityFilter {\n constructor(readonly values: string[]) {}\n\n filterEntity(entity: Entity): boolean {\n return this.values.some(v => entity.spec?.lifecycle === v);\n }\n\n toQueryValue(): string[] {\n return this.values;\n }\n}\n\n/**\n * Filters entities based on whatever the user has starred or owns them.\n * @public\n */\nexport class UserListFilter implements EntityFilter {\n constructor(\n readonly value: UserListFilterKind,\n readonly isOwnedEntity: (entity: Entity) => boolean,\n readonly isStarredEntity: (entity: Entity) => boolean,\n ) {}\n\n filterEntity(entity: Entity): boolean {\n switch (this.value) {\n case 'owned':\n return this.isOwnedEntity(entity);\n case 'starred':\n return this.isStarredEntity(entity);\n default:\n return true;\n }\n }\n\n toQueryValue(): string {\n return this.value;\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 { useEffect, useMemo, useRef, useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '../api';\nimport { useEntityList } from './useEntityListProvider';\nimport { EntityTypeFilter } from '../filters';\n\n/**\n * A hook built on top of `useEntityList` for enabling selection of valid `spec.type` values\n * based on the selected EntityKindFilter.\n * @public\n */\nexport function useEntityTypeFilter(): {\n loading: boolean;\n error?: Error;\n availableTypes: string[];\n selectedTypes: string[];\n setSelectedTypes: (types: string[]) => void;\n} {\n const catalogApi = useApi(catalogApiRef);\n const {\n filters: { kind: kindFilter, type: typeFilter },\n queryParameters: { type: typeParameter },\n updateFilters,\n } = useEntityList();\n\n const flattenedQueryTypes = useMemo(\n () => [typeParameter].flat().filter(Boolean) as string[],\n [typeParameter],\n );\n\n const [selectedTypes, setSelectedTypes] = useState(\n flattenedQueryTypes.length\n ? flattenedQueryTypes\n : typeFilter?.getTypes() ?? [],\n );\n\n // Set selected types on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (flattenedQueryTypes.length) {\n setSelectedTypes(flattenedQueryTypes);\n }\n }, [flattenedQueryTypes]);\n\n const [availableTypes, setAvailableTypes] = useState<string[]>([]);\n const kind = useMemo(() => kindFilter?.value, [kindFilter]);\n\n // Load all valid spec.type values straight from the catalogApi, paying attention to only the\n // kind filter for a complete list.\n const {\n error,\n loading,\n value: facets,\n } = useAsync(async () => {\n if (kind) {\n const items = await catalogApi\n .getEntityFacets({\n filter: { kind },\n facets: ['spec.type'],\n })\n .then(response => response.facets['spec.type'] || []);\n return items;\n }\n return [];\n }, [kind, catalogApi]);\n\n const facetsRef = useRef(facets);\n useEffect(() => {\n const oldFacets = facetsRef.current;\n facetsRef.current = facets;\n // Delay processing hook until kind and facets load updates have settled to generate list of types;\n // This prevents resetting the type filter due to saved type value from query params not matching the\n // empty set of type values while values are still being loaded; also only run this hook on changes\n // to facets\n if (loading || !kind || oldFacets === facets || !facets) {\n return;\n }\n\n // Sort by facet count descending, so the most common types appear on top\n const newTypes = sortBy(facets, f => -f.count).map(f => f.value);\n setAvailableTypes(newTypes);\n\n // Update type filter to only valid values when the list of available types has changed\n const stillValidTypes = selectedTypes.filter(value =>\n newTypes.includes(value),\n );\n if (!isEqual(selectedTypes, stillValidTypes)) {\n setSelectedTypes(stillValidTypes);\n }\n }, [loading, kind, selectedTypes, setSelectedTypes, facets]);\n\n useEffect(() => {\n updateFilters({\n type: selectedTypes.length\n ? new EntityTypeFilter(selectedTypes)\n : undefined,\n });\n }, [selectedTypes, updateFilters]);\n\n return {\n loading,\n error,\n availableTypes,\n selectedTypes,\n setSelectedTypes,\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 */\nimport { Entity, parseEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { chunk, groupBy } from 'lodash';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../api';\n\nconst BATCH_SIZE = 20;\n\n/** @public */\nexport function useRelatedEntities(\n entity: Entity,\n relationFilter: { type?: string; kind?: string },\n): {\n entities: Entity[] | undefined;\n loading: boolean;\n error: Error | undefined;\n} {\n const filterByTypeLower = relationFilter?.type?.toLocaleLowerCase('en-US');\n const filterByKindLower = relationFilter?.kind?.toLocaleLowerCase('en-US');\n\n const catalogApi = useApi(catalogApiRef);\n const {\n loading,\n value: entities,\n error,\n } = useAsync(async () => {\n const relations = entity.relations\n ?.map(r => ({ type: r.type, target: parseEntityRef(r.targetRef) }))\n .filter(\n r =>\n (!filterByTypeLower ||\n r.type.toLocaleLowerCase('en-US') === filterByTypeLower) &&\n (!filterByKindLower || r.target.kind === filterByKindLower),\n );\n\n if (!relations) {\n return [];\n }\n\n // Group the relations by kind and namespace to reduce the size of the request query string.\n // Without this grouping, the kind and namespace would need to be specified for each relation, e.g.\n // `filter=kind=component,namespace=default,name=example1&filter=kind=component,namespace=default,name=example2`\n // with grouping, we can generate a query a string like\n // `filter=kind=component,namespace=default,name=example1,example2`\n const relationsByKindAndNamespace = Object.values(\n groupBy(relations, ({ target }) => {\n return `${target.kind}:${target.namespace}`.toLocaleLowerCase('en-US');\n }),\n );\n\n // Split the names within each group into batches to further reduce the query string length.\n const batchedRelationsByKindAndNamespace: {\n kind: string;\n namespace: string;\n nameBatches: string[][];\n }[] = [];\n for (const rs of relationsByKindAndNamespace) {\n batchedRelationsByKindAndNamespace.push({\n // All relations in a group have the same kind and namespace, so its arbitrary which we pick\n kind: rs[0].target.kind,\n namespace: rs[0].target.namespace,\n nameBatches: chunk(\n rs.map(r => r.target.name),\n BATCH_SIZE,\n ),\n });\n }\n\n const results = await Promise.all(\n batchedRelationsByKindAndNamespace.flatMap(rs => {\n return rs.nameBatches.map(names => {\n return catalogApi.getEntities({\n filter: {\n kind: rs.kind,\n 'metadata.namespace': rs.namespace,\n 'metadata.name': names,\n },\n });\n });\n }),\n );\n\n return results.flatMap(r => r.items);\n }, [entity, filterByTypeLower, filterByKindLower]);\n\n return {\n entities,\n loading,\n error,\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 {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback } from 'react';\nimport useObservable from 'react-use/lib/useObservable';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntities(): {\n starredEntities: Set<string>;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n isStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const starredEntities = useObservable(\n starredEntitiesApi.starredEntitie$(),\n new Set<string>(),\n );\n\n const isStarredEntity = useCallback(\n (entityOrRef: Entity | CompoundEntityRef | string) =>\n starredEntities.has(getEntityRef(entityOrRef)),\n [starredEntities],\n );\n\n const toggleStarredEntity = useCallback(\n (entityOrRef: Entity | CompoundEntityRef | string) =>\n starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [starredEntitiesApi],\n );\n\n return {\n starredEntities,\n toggleStarredEntity,\n isStarredEntity,\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 Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback, useEffect, useState } from 'react';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntity(\n entityOrRef: Entity | CompoundEntityRef | string,\n): {\n toggleStarredEntity: () => void;\n isStarredEntity: boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const [isStarredEntity, setIsStarredEntity] = useState(false);\n\n useEffect(() => {\n const subscription = starredEntitiesApi.starredEntitie$().subscribe({\n next(starredEntities: Set<string>) {\n setIsStarredEntity(starredEntities.has(getEntityRef(entityOrRef)));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [entityOrRef, starredEntitiesApi]);\n\n const toggleStarredEntity = useCallback(\n () => starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [entityOrRef, starredEntitiesApi],\n );\n\n return {\n toggleStarredEntity,\n isStarredEntity,\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 Entity,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { getEntityRelations } from '../utils/getEntityRelations';\n\n/**\n * Returns a function that checks whether the currently signed-in user is an\n * owner of a given entity. When the hook is initially mounted, the loading\n * flag will be true and the results returned from the function will always be\n * false.\n *\n * @public\n *\n * @returns a function that checks if the signed in user owns an entity\n */\nexport function useEntityOwnership(): {\n loading: boolean;\n isOwnedEntity: (entity: Entity) => boolean;\n} {\n const identityApi = useApi(identityApiRef);\n\n // Trigger load only on mount\n const { loading, value: refs } = useAsync(async () => {\n const { ownershipEntityRefs } = await identityApi.getBackstageIdentity();\n return ownershipEntityRefs;\n }, []);\n\n const isOwnedEntity = useMemo(() => {\n const myOwnerRefs = new Set(refs ?? []);\n return (entity: Entity) => {\n const entityOwnerRefs = getEntityRelations(entity, RELATION_OWNED_BY).map(\n stringifyEntityRef,\n );\n for (const ref of entityOwnerRefs) {\n if (myOwnerRefs.has(ref)) {\n return true;\n }\n }\n return false;\n };\n }, [refs]);\n\n return useMemo(() => ({ loading, isOwnedEntity }), [loading, isOwnedEntity]);\n}\n","/*\n * Copyright 2022 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 { ResourcePermission } from '@backstage/plugin-permission-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { useAsyncEntity } from './useEntity';\n\n/**\n * A thin wrapper around the\n * {@link @backstage/plugin-permission-react#usePermission} hook which uses the\n * current entity in context to make an authorization request for the given\n * {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.\n *\n * Note: this hook blocks the permission request until the entity has loaded in\n * context. If you have the entityRef and need concurrent requests, use the\n * `usePermission` hook directly.\n * @alpha\n */\nexport function useEntityPermission(\n // TODO(joeporpeglia) Replace with `CatalogEntityPermission` when the issue described in\n // https://github.com/backstage/backstage/pull/10128 is fixed.\n permission: ResourcePermission<'catalog-entity'>,\n): {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n} {\n const {\n entity,\n loading: loadingEntity,\n error: entityError,\n } = useAsyncEntity();\n const {\n allowed,\n loading: loadingPermission,\n error: permissionError,\n } = usePermission({\n permission,\n resourceRef: entity ? stringifyEntityRef(entity) : undefined,\n });\n\n if (loadingEntity || loadingPermission) {\n return { loading: true, allowed: false };\n }\n if (entityError) {\n return { loading: false, allowed: false, error: entityError };\n }\n return { loading: false, allowed, error: permissionError };\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, { useEffect, useState } from 'react';\nimport { Alert } from '@material-ui/lab';\nimport { useEntityList } from '../../hooks';\nimport { EntityKindFilter } from '../../filters';\n\n/**\n * Props for {@link EntityKindPicker}.\n *\n * @public\n */\nexport interface EntityKindPickerProps {\n initialFilter?: string;\n hidden: boolean;\n}\n\n/** @public */\nexport const EntityKindPicker = (props: EntityKindPickerProps) => {\n const { initialFilter, hidden } = props;\n\n const {\n updateFilters,\n queryParameters: { kind: kindParameter },\n } = useEntityList();\n const [selectedKind] = useState([kindParameter].flat()[0] ?? initialFilter);\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined,\n });\n }, [selectedKind, updateFilters]);\n\n if (hidden) return null;\n\n // TODO(timbonicus): This should load available kinds from the catalog-backend, similar to\n // EntityTypePicker.\n\n return <Alert severity=\"warning\">Kind filter not yet available</Alert>;\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 { Entity } from '@backstage/catalog-model';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityLifecycleFilter } from '../../filters';\n\n/** @public */\nexport type CatalogReactEntityLifecyclePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityLifecyclePicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityLifecyclePicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n backendEntities,\n filters,\n queryParameters: { lifecycles: lifecyclesParameter },\n } = useEntityList();\n\n const queryParamLifecycles = useMemo(\n () => [lifecyclesParameter].flat().filter(Boolean) as string[],\n [lifecyclesParameter],\n );\n\n const [selectedLifecycles, setSelectedLifecycles] = useState(\n queryParamLifecycles.length\n ? queryParamLifecycles\n : filters.lifecycles?.values ?? [],\n );\n\n // Set selected lifecycles on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamLifecycles.length) {\n setSelectedLifecycles(queryParamLifecycles);\n }\n }, [queryParamLifecycles]);\n\n useEffect(() => {\n updateFilters({\n lifecycles: selectedLifecycles.length\n ? new EntityLifecycleFilter(selectedLifecycles)\n : undefined,\n });\n }, [selectedLifecycles, updateFilters]);\n\n const availableLifecycles = useMemo(\n () =>\n [\n ...new Set(\n backendEntities\n .map((e: Entity) => e.spec?.lifecycle)\n .filter(Boolean) as string[],\n ),\n ].sort(),\n [backendEntities],\n );\n\n if (!availableLifecycles.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Lifecycle</Typography>\n <Autocomplete\n aria-label=\"Lifecycle\"\n multiple\n options={availableLifecycles}\n value={selectedLifecycles}\n onChange={(_: object, value: string[]) => setSelectedLifecycles(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"lifecycle-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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 { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityOwnerFilter } from '../../filters';\nimport { getEntityRelations } from '../../utils';\nimport { humanizeEntityRef } from '../EntityRefLink';\n\n/** @public */\nexport type CatalogReactEntityOwnerPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityOwnerPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityOwnerPicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n backendEntities,\n filters,\n queryParameters: { owners: ownersParameter },\n } = useEntityList();\n\n const queryParamOwners = useMemo(\n () => [ownersParameter].flat().filter(Boolean) as string[],\n [ownersParameter],\n );\n\n const [selectedOwners, setSelectedOwners] = useState(\n queryParamOwners.length ? queryParamOwners : filters.owners?.values ?? [],\n );\n\n // Set selected owners on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamOwners.length) {\n setSelectedOwners(queryParamOwners);\n }\n }, [queryParamOwners]);\n\n useEffect(() => {\n updateFilters({\n owners: selectedOwners.length\n ? new EntityOwnerFilter(selectedOwners)\n : undefined,\n });\n }, [selectedOwners, updateFilters]);\n\n const availableOwners = useMemo(\n () =>\n [\n ...new Set(\n backendEntities\n .flatMap((e: Entity) =>\n getEntityRelations(e, RELATION_OWNED_BY).map(o =>\n humanizeEntityRef(o, { defaultKind: 'group' }),\n ),\n )\n .filter(Boolean) as string[],\n ),\n ].sort(),\n [backendEntities],\n );\n\n if (!availableOwners.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Owner</Typography>\n <Autocomplete\n multiple\n aria-label=\"Owner\"\n options={availableOwners}\n value={selectedOwners}\n onChange={(_: object, value: string[]) => setSelectedOwners(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"owner-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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 {\n FormControl,\n IconButton,\n Input,\n InputAdornment,\n makeStyles,\n Toolbar,\n} from '@material-ui/core';\nimport Clear from '@material-ui/icons/Clear';\nimport Search from '@material-ui/icons/Search';\nimport React, { useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityTextFilter } from '../../filters';\n\n/** @public */\nexport type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';\n\nconst useStyles = makeStyles(\n _theme => ({\n searchToolbar: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n input: {},\n }),\n {\n name: 'CatalogReactEntitySearchBar',\n },\n);\n\n/**\n * Renders search bar for filtering the entity list.\n * @public\n */\nexport const EntitySearchBar = () => {\n const classes = useStyles();\n\n const { filters, updateFilters } = useEntityList();\n const [search, setSearch] = useState(filters.text?.value ?? '');\n\n useDebounce(\n () => {\n updateFilters({\n text: search.length ? new EntityTextFilter(search) : undefined,\n });\n },\n 250,\n [search, updateFilters],\n );\n\n return (\n <Toolbar className={classes.searchToolbar}>\n <FormControl>\n <Input\n aria-label=\"search\"\n id=\"input-with-icon-adornment\"\n className={classes.input}\n placeholder=\"Search\"\n autoComplete=\"off\"\n onChange={event => setSearch(event.target.value)}\n value={search}\n startAdornment={\n <InputAdornment position=\"start\">\n <Search />\n </InputAdornment>\n }\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear search\"\n onClick={() => setSearch('')}\n edge=\"end\"\n disabled={search.length === 0}\n >\n <Clear />\n </IconButton>\n </InputAdornment>\n }\n />\n </FormControl>\n </Toolbar>\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 {\n Entity,\n CompoundEntityRef,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport React from 'react';\nimport { getEntityRelations } from '../../utils';\nimport {\n EntityRefLink,\n EntityRefLinks,\n humanizeEntityRef,\n} from '../EntityRefLink';\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn<T extends Entity>(options: {\n defaultKind?: string;\n }): TableColumn<T> {\n const { defaultKind } = options;\n function formatContent(entity: T): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind,\n })\n );\n }\n\n return {\n title: 'Name',\n highlight: true,\n customFilterAndSearch(filter, entity) {\n // TODO: We could implement this more efficiently, like searching over\n // each field that is displayed individually (kind, namespace, name).\n // but that might confuse the user as it will behave different than a\n // simple text search.\n // Another alternative would be to cache the values. But writing them\n // into the entity feels bad too.\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={defaultKind}\n title={entity.metadata?.title}\n />\n ),\n };\n },\n createEntityRelationColumn<T extends Entity>({\n title,\n relation,\n defaultKind,\n filter: entityFilter,\n }: {\n title: string;\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n }): TableColumn<T> {\n function getRelations(entity: T): CompoundEntityRef[] {\n return getEntityRelations(entity, relation, entityFilter);\n }\n\n function formatContent(entity: T): string {\n return getRelations(entity)\n .map(r => humanizeEntityRef(r, { defaultKind }))\n .join(', ');\n }\n\n return {\n title,\n customFilterAndSearch(filter, entity) {\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => {\n return (\n <EntityRefLinks\n entityRefs={getRelations(entity)}\n defaultKind={defaultKind}\n />\n );\n },\n };\n },\n createOwnerColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'Owner',\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n createDomainColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'Domain',\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: {\n kind: 'domain',\n },\n });\n },\n createSystemColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: 'System',\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: {\n kind: 'system',\n },\n });\n },\n createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Description',\n field: 'metadata.description',\n render: entity => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n line={2}\n />\n ),\n width: 'auto',\n };\n },\n createSpecLifecycleColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Lifecycle',\n field: 'spec.lifecycle',\n };\n },\n createSpecTypeColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: 'Type',\n field: 'spec.type',\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 { ComponentEntity, SystemEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createDomainColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\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 { Entity } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core';\nimport React, { ReactNode } from 'react';\nimport { columnFactories } from './columns';\nimport { componentEntityColumns, systemEntityColumns } from './presets';\nimport {\n InfoCardVariants,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTable}.\n *\n * @public\n */\nexport interface EntityTableProps<T extends Entity> {\n title: string;\n variant?: InfoCardVariants;\n entities: T[];\n emptyContent?: ReactNode;\n columns: TableColumn<T>[];\n}\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\n/**\n * A general entity table component, that can be used for composing more\n * specific entity tables.\n *\n * @public\n */\nexport const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {\n const {\n entities,\n title,\n emptyContent,\n variant = 'gridItem',\n columns,\n } = props;\n\n const classes = useStyles();\n const tableStyle: React.CSSProperties = {\n minWidth: '0',\n width: '100%',\n };\n\n if (variant === 'gridItem') {\n tableStyle.height = 'calc(100% - 10px)';\n }\n\n return (\n <Table<T>\n columns={columns}\n title={title}\n style={tableStyle}\n emptyContent={\n emptyContent && <div className={classes.empty}>{emptyContent}</div>\n }\n options={{\n // TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;\n search: false,\n paging: false,\n actionsColumnIndex: -1,\n padding: 'dense',\n }}\n data={entities}\n />\n );\n};\n\nEntityTable.columns = columnFactories;\n\nEntityTable.systemEntityColumns = systemEntityColumns;\n\nEntityTable.componentEntityColumns = componentEntityColumns;\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 Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityTagFilter } from '../../filters';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../api';\n\n/** @public */\nexport type CatalogReactEntityTagPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityTagPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityTagPicker = () => {\n const classes = useStyles();\n const {\n updateFilters,\n filters,\n queryParameters: { tags: tagsParameter },\n } = useEntityList();\n\n const catalogApi = useApi(catalogApiRef);\n const { value: availableTags } = useAsync(async () => {\n const facet = 'metadata.tags';\n const { facets } = await catalogApi.getEntityFacets({\n facets: [facet],\n filter: filters.kind?.getCatalogFilters(),\n });\n\n return facets[facet].map(({ value }) => value);\n }, [filters.kind]);\n\n const queryParamTags = useMemo(\n () => [tagsParameter].flat().filter(Boolean) as string[],\n [tagsParameter],\n );\n\n const [selectedTags, setSelectedTags] = useState(\n queryParamTags.length ? queryParamTags : filters.tags?.values ?? [],\n );\n\n // Set selected tags on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamTags.length) {\n setSelectedTags(queryParamTags);\n }\n }, [queryParamTags]);\n\n useEffect(() => {\n updateFilters({\n tags: selectedTags.length ? new EntityTagFilter(selectedTags) : undefined,\n });\n }, [selectedTags, updateFilters]);\n\n if (!availableTags?.length) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Tags</Typography>\n <Autocomplete\n multiple\n aria-label=\"Tags\"\n options={availableTags}\n value={selectedTags}\n onChange={(_: object, value: string[]) => setSelectedTags(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"tag-picker-expand\" />}\n renderInput={params => (\n <TextField {...params} className={classes.input} variant=\"outlined\" />\n )}\n />\n </Box>\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, { useEffect } from 'react';\nimport capitalize from 'lodash/capitalize';\nimport { Box } from '@material-ui/core';\nimport { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter';\n\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Select } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTypePicker}.\n *\n * @public\n */\nexport interface EntityTypePickerProps {\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityTypePicker = (props: EntityTypePickerProps) => {\n const { hidden, initialFilter } = props;\n const alertApi = useApi(alertApiRef);\n const { error, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity types`,\n severity: 'error',\n });\n }\n if (initialFilter) {\n setSelectedTypes([initialFilter]);\n }\n }, [error, alertApi, initialFilter, setSelectedTypes]);\n\n if (availableTypes.length === 0 || error) return null;\n\n const items = [\n { value: 'all', label: 'All' },\n ...availableTypes.map((type: string) => ({\n value: type,\n label: capitalize(type),\n })),\n ];\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Type\"\n items={items}\n selected={(items.length > 1 ? selectedTypes[0] : undefined) ?? 'all'}\n onChange={value =>\n setSelectedTypes(value === 'all' ? [] : [String(value)])\n }\n />\n </Box>\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 { Entity } from '@backstage/catalog-model';\nimport { IconButton, Tooltip, withStyles } from '@material-ui/core';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n return (\n <IconButton\n aria-label=\"favorite\"\n color=\"inherit\"\n {...props}\n onClick={() => toggleStarredEntity()}\n >\n <Tooltip\n title={isStarredEntity ? 'Remove from favorites' : 'Add to favorites'}\n >\n {isStarredEntity ? <YellowStar /> : <StarBorder />}\n </Tooltip>\n </IconButton>\n );\n};\n","/*\n * Copyright 2022 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 { parseEntityRef } from '@backstage/catalog-model';\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nconst DEFAULT_ICON = WorkIcon;\n\nfunction getKind(\n kind: string | undefined,\n entityRef: string | undefined,\n): string | undefined {\n if (kind) {\n return kind.toLocaleLowerCase('en-US');\n }\n\n if (entityRef) {\n try {\n return parseEntityRef(entityRef).kind.toLocaleLowerCase('en-US');\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\nfunction useIcon(kind: string | undefined, entityRef: string | undefined) {\n const app = useApp();\n\n const actualKind = getKind(kind, entityRef);\n if (!actualKind) {\n return DEFAULT_ICON;\n }\n\n const icon = app.getSystemIcon(`kind:${actualKind}`);\n return icon || DEFAULT_ICON;\n}\n\nexport function EntityKindIcon(props: {\n kind?: string;\n entityRef?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const { kind, entityRef, ...otherProps } = props;\n const Icon = useIcon(kind, entityRef);\n return <Icon {...otherProps} />;\n}\n","/*\n * Copyright 2022 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 Entity,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { Box, DialogContentText, makeStyles } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { humanizeEntityRef } from '../../EntityRefLink';\nimport { entityRouteRef } from '../../../routes';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles(theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\ntype NodeType = Entity & { root: boolean };\n\nfunction useAncestry(root: Entity): {\n loading: boolean;\n error?: Error;\n nodes: DependencyGraphTypes.DependencyNode<NodeType>[];\n edges: DependencyGraphTypes.DependencyEdge[];\n} {\n const catalogClient = useApi(catalogApiRef);\n const entityRef = stringifyEntityRef(root);\n\n const { loading, error, value } = useAsync(async () => {\n const response = await catalogClient.getEntityAncestors({ entityRef });\n const nodes = new Array<DependencyGraphTypes.DependencyNode<NodeType>>();\n const edges = new Array<DependencyGraphTypes.DependencyEdge>();\n for (const current of response.items) {\n const currentRef = stringifyEntityRef(current.entity);\n const isRootNode = currentRef === response.rootEntityRef;\n nodes.push({ id: currentRef, root: isRootNode, ...current.entity });\n for (const parentRef of current.parentEntityRefs) {\n edges.push({ from: currentRef, to: parentRef });\n }\n }\n return { nodes, edges };\n }, [entityRef]);\n\n return {\n loading,\n error,\n nodes: value?.nodes || [],\n edges: value?.edges || [],\n };\n}\n\nfunction CustomNode({ node }: DependencyGraphTypes.RenderNodeProps<NodeType>) {\n const classes = useStyles();\n const navigate = useNavigate();\n const entityRoute = useRouteRef(entityRouteRef);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = iconSize + padding;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n node.metadata.title ||\n (node.kind && node.metadata.name && node.metadata.namespace\n ? humanizeEntityRef({\n kind: node.kind,\n name: node.metadata.name,\n namespace: node.metadata.namespace || '',\n })\n : node.id);\n\n const onClick = () => {\n navigate(\n entityRoute({\n kind: node.kind,\n namespace: node.metadata.namespace || DEFAULT_NAMESPACE,\n name: node.metadata.name,\n }),\n );\n };\n\n return (\n <g onClick={onClick} className={classes.clickable}>\n <rect\n className={classNames(\n classes.node,\n node.root ? 'secondary' : 'primary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n <EntityKindIcon\n kind={node.kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n />\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n\nexport function AncestryPage(props: { entity: Entity }) {\n const { loading, error, nodes, edges } = useAncestry(props.entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <>\n <DialogContentText variant=\"h2\">Ancestry</DialogContentText>\n <DialogContentText gutterBottom>\n This is the ancestry of entities above the current one - as in, the\n chain(s) of entities down to the current one, where{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/life-of-an-entity\">\n processors emitted\n </Link>{' '}\n child entities that ultimately led to the current one existing. Note\n that this is a completely different mechanism from relations.\n </DialogContentText>\n <Box mt={4}>\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={CustomNode}\n direction={DependencyGraphTypes.Direction.BOTTOM_TOP}\n zoom=\"enable-on-click\"\n />\n </Box>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { Link } from '@backstage/core-components';\nimport {\n Box,\n Card,\n CardContent,\n ListItem,\n ListItemIcon,\n ListItemText as MuiListItemText,\n ListSubheader as MuiListSubheader,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n marginTop: {\n marginTop: theme.spacing(2),\n },\n helpIcon: {\n marginLeft: theme.spacing(1),\n color: theme.palette.text.disabled,\n },\n monospace: {\n fontFamily: 'monospace',\n },\n}));\n\nexport function ListItemText(props: {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n}) {\n const classes = useStyles();\n return (\n <MuiListItemText\n {...props}\n primaryTypographyProps={{ className: classes.monospace }}\n secondaryTypographyProps={{ className: classes.monospace }}\n />\n );\n}\n\nexport function ListSubheader(props: { children?: React.ReactNode }) {\n const classes = useStyles();\n return (\n <MuiListSubheader className={classes.monospace}>\n {props.children}\n </MuiListSubheader>\n );\n}\n\nexport function Container(props: {\n title: React.ReactNode;\n helpLink?: string;\n children: React.ReactNode;\n}) {\n return (\n <Box mt={2}>\n <Card variant=\"outlined\">\n <CardContent>\n <Typography variant=\"h6\" gutterBottom>\n {props.title}\n {props.helpLink && <HelpIcon to={props.helpLink} />}\n </Typography>\n {props.children}\n </CardContent>\n </Card>\n </Box>\n );\n}\n\nexport function KeyValueListItem(props: {\n indent?: boolean;\n entry: [string, string];\n}) {\n const [key, value] = props.entry;\n return (\n <ListItem>\n {props.indent && <ListItemIcon />}\n <ListItemText\n primary={key}\n secondary={\n !value.match(/^url:https?:\\/\\//) ? (\n value\n ) : (\n <>\n {value.substring(0, 4)}\n <Link to={value.substring(4)}>{value.substring(4)}</Link>\n </>\n )\n }\n />\n </ListItem>\n );\n}\n\nexport function HelpIcon(props: { to: string }) {\n const classes = useStyles();\n return (\n <Link to={props.to} className={classes.helpIcon}>\n <HelpOutlineIcon fontSize=\"inherit\" />\n </Link>\n );\n}\n","/*\n * Copyright 2022 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 Entity,\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n DialogContentText,\n List,\n ListItem,\n ListItemIcon,\n makeStyles,\n} from '@material-ui/core';\nimport { Alert } from '@material-ui/lab';\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { KeyValueListItem, ListItemText } from './common';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nfunction useColocated(entity: Entity): {\n loading: boolean;\n error?: Error;\n location?: string;\n originLocation?: string;\n colocatedEntities?: Entity[];\n} {\n const catalogApi = useApi(catalogApiRef);\n const currentEntityRef = stringifyEntityRef(entity);\n const location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n const origin = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n\n const { loading, error, value } = useAsync(async () => {\n if (!location && !origin) {\n return [];\n }\n const response = await catalogApi.getEntities({\n filter: [\n ...(location\n ? [{ [`metadata.annotations.${ANNOTATION_LOCATION}`]: location }]\n : []),\n ...(origin\n ? [{ [`metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`]: origin }]\n : []),\n ],\n });\n return response.items;\n }, [location, origin]);\n\n return {\n loading,\n error,\n location,\n originLocation: origin,\n colocatedEntities: value?.filter(\n colocated => stringifyEntityRef(colocated) !== currentEntityRef,\n ),\n };\n}\n\nfunction EntityList(props: { entities: Entity[]; header?: [string, string] }) {\n return (\n <List dense>\n {props.header && <KeyValueListItem key=\"header\" entry={props.header} />}\n {props.entities.map(entity => (\n <ListItem key={stringifyEntityRef(entity)}>\n <ListItemIcon>\n <EntityKindIcon kind={entity.kind} />\n </ListItemIcon>\n <ListItemText primary={<EntityRefLink entityRef={entity} />} />\n </ListItem>\n ))}\n </List>\n );\n}\n\nfunction Contents(props: { entity: Entity }) {\n const { entity } = props;\n\n const { loading, error, location, originLocation, colocatedEntities } =\n useColocated(entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!location && !originLocation) {\n return (\n <Alert severity=\"warning\">Entity had no location information.</Alert>\n );\n } else if (!colocatedEntities?.length) {\n return (\n <Alert severity=\"info\">\n There were no other entities on this location.\n </Alert>\n );\n }\n\n if (location === originLocation) {\n return <EntityList entities={colocatedEntities} />;\n }\n\n const atLocation = colocatedEntities.filter(\n e => e.metadata.annotations?.[ANNOTATION_LOCATION] === location,\n );\n const atOrigin = colocatedEntities.filter(\n e =>\n e.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION] === originLocation,\n );\n\n return (\n <>\n {atLocation.length > 0 && (\n <EntityList\n entities={atLocation}\n header={['At the same location', location!]}\n />\n )}\n {atOrigin.length > 0 && (\n <EntityList\n entities={atOrigin}\n header={['At the same origin', originLocation!]}\n />\n )}\n </>\n );\n}\n\nexport function ColocatedPage(props: { entity: Entity }) {\n const classes = useStyles();\n return (\n <>\n <DialogContentText variant=\"h2\">Colocated</DialogContentText>\n <DialogContentText>\n These are the entities that are colocated with this entity - as in, they\n originated from the same data source (e.g. came from the same YAML\n file), or from the same origin (e.g. the originally registered URL).\n </DialogContentText>\n <div className={classes.root}>\n <Contents entity={props.entity} />\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { JsonObject } from '@backstage/types';\n\nexport function sortKeys(data: JsonObject): JsonObject {\n // we could do something custom, but lexicographical sorting is actually a\n // good choice at least for the default set of keys\n return Object.fromEntries(\n [...Object.entries(data)].sort((a, b) => (a[0] < b[0] ? -1 : 1)),\n );\n}\n","/*\n * Copyright 2022 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 { CodeSnippet } from '@backstage/core-components';\nimport { DialogContentText } from '@material-ui/core';\nimport React from 'react';\nimport { sortKeys } from './util';\n\nexport function JsonPage(props: { entity: Entity }) {\n return (\n <>\n <DialogContentText variant=\"h2\">Entity as JSON</DialogContentText>\n <DialogContentText>\n This is the raw entity data as received from the catalog, on JSON form.\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={JSON.stringify(sortKeys(props.entity), undefined, 2)}\n language=\"json\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { AlphaEntity } from '@backstage/catalog-model';\nimport {\n Box,\n DialogContentText,\n List,\n ListItem,\n ListItemIcon,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport React from 'react';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport {\n Container,\n HelpIcon,\n KeyValueListItem,\n ListItemText,\n ListSubheader,\n} from './common';\nimport { EntityKindIcon } from './EntityKindIcon';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nexport function OverviewPage(props: { entity: AlphaEntity }) {\n const classes = useStyles();\n const {\n apiVersion,\n kind,\n metadata,\n spec,\n relations = [],\n status = {},\n } = props.entity;\n\n const groupedRelations = groupBy(\n sortBy(relations, r => r.targetRef),\n 'type',\n );\n\n return (\n <>\n <DialogContentText variant=\"h2\">Overview</DialogContentText>\n <div className={classes.root}>\n <Container title=\"Identity\">\n <List dense>\n <ListItem>\n <ListItemText primary=\"apiVersion\" secondary={apiVersion} />\n </ListItem>\n <ListItem>\n <ListItemText primary=\"kind\" secondary={kind} />\n </ListItem>\n {spec?.type && (\n <ListItem>\n <ListItemText primary=\"spec.type\" secondary={spec.type} />\n </ListItem>\n )}\n {metadata.uid && (\n <ListItem>\n <ListItemText primary=\"uid\" secondary={metadata.uid} />\n </ListItem>\n )}\n {metadata.etag && (\n <ListItem>\n <ListItemText primary=\"etag\" secondary={metadata.etag} />\n </ListItem>\n )}\n </List>\n </Container>\n\n <Container title=\"Metadata\">\n {!!Object.keys(metadata.annotations || {}).length && (\n <List\n dense\n subheader={\n <ListSubheader>\n Annotations\n <HelpIcon to=\"https://backstage.io/docs/features/software-catalog/well-known-annotations\" />\n </ListSubheader>\n }\n >\n {Object.entries(metadata.annotations!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!Object.keys(metadata.labels || {}).length && (\n <List dense subheader={<ListSubheader>Labels</ListSubheader>}>\n {Object.entries(metadata.labels!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!metadata.tags?.length && (\n <List dense subheader={<ListSubheader>Tags</ListSubheader>}>\n {metadata.tags.map((tag, index) => (\n <ListItem key={`${tag}-${index}`}>\n <ListItemIcon />\n <ListItemText primary={tag} />\n </ListItem>\n ))}\n </List>\n )}\n </Container>\n\n {!!relations.length && (\n <Container\n title=\"Relations\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-relations\"\n >\n {Object.entries(groupedRelations).map(\n ([type, groupRelations], index) => (\n <div key={index}>\n <List dense subheader={<ListSubheader>{type}</ListSubheader>}>\n {groupRelations.map(group => (\n <ListItem key={group.targetRef}>\n <ListItemIcon>\n <EntityKindIcon entityRef={group.targetRef} />\n </ListItemIcon>\n <ListItemText\n primary={\n <EntityRefLink entityRef={group.targetRef} />\n }\n />\n </ListItem>\n ))}\n </List>\n </div>\n ),\n )}\n </Container>\n )}\n\n {!!status.items?.length && (\n <Container\n title=\"Status\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-statuses\"\n >\n {status.items.map((item, index) => (\n <div key={index}>\n <Typography>\n {item.level}: {item.type}\n </Typography>\n <Box ml={2}>{item.message}</Box>\n </div>\n ))}\n </Container>\n )}\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 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 { CodeSnippet } from '@backstage/core-components';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport React from 'react';\nimport YAML from 'yaml';\nimport { sortKeys } from './util';\n\nexport function YamlPage(props: { entity: Entity }) {\n return (\n <>\n <DialogContentText variant=\"h2\">Entity as YAML</DialogContentText>\n <DialogContentText>\n This is the raw entity data as received from the catalog, on YAML form.\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={YAML.stringify(sortKeys(props.entity))}\n language=\"yaml\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\n * Copyright 2022 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 Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n makeStyles,\n Tab,\n Tabs,\n} from '@material-ui/core';\nimport React, { useEffect } from 'react';\nimport { AncestryPage } from './components/AncestryPage';\nimport { ColocatedPage } from './components/ColocatedPage';\nimport { JsonPage } from './components/JsonPage';\nimport { OverviewPage } from './components/OverviewPage';\nimport { YamlPage } from './components/YamlPage';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n backgroundColor: theme.palette.background.paper,\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n}));\n\nfunction TabPanel(props: {\n children?: React.ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the low level details of their entities.\n *\n * @public\n */\nexport function InspectEntityDialog(props: {\n open: boolean;\n entity: Entity;\n onClose: () => void;\n}) {\n const classes = useStyles();\n const [activeTab, setActiveTab] = React.useState(0);\n\n useEffect(() => {\n setActiveTab(0);\n }, [props.open]);\n\n if (!props.entity) {\n return null;\n }\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={props.open}\n onClose={props.onClose}\n aria-labelledby=\"entity-inspector-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"entity-inspector-dialog-title\">\n Entity Inspector\n </DialogTitle>\n <DialogContent dividers>\n <div className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label=\"Inspector options\"\n className={classes.tabs}\n >\n <Tab label=\"Overview\" {...a11yProps(0)} />\n <Tab label=\"Ancestry\" {...a11yProps(1)} />\n <Tab label=\"Colocated\" {...a11yProps(2)} />\n <Tab label=\"Raw JSON\" {...a11yProps(3)} />\n <Tab label=\"Raw YAML\" {...a11yProps(4)} />\n </Tabs>\n\n <TabPanel value={activeTab} index={0}>\n <OverviewPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={1}>\n <AncestryPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={2}>\n <ColocatedPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={3}>\n <JsonPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={4}>\n <YamlPage entity={props.entity} />\n </TabPanel>\n </div>\n </DialogContent>\n <DialogActions>\n <Button onClick={props.onClose} color=\"primary\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\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 Entity,\n CompoundEntityRef,\n getCompoundEntityRef,\n ANNOTATION_ORIGIN_LOCATION,\n} from '@backstage/catalog-model';\nimport { catalogApiRef } from '../../api';\nimport { useCallback } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * Each distinct state that the dialog can be in at any given time.\n */\nexport type UseUnregisterEntityDialogState =\n | {\n type: 'loading';\n }\n | {\n type: 'error';\n error: Error;\n }\n | {\n type: 'bootstrap';\n location: string;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'unregister';\n location: string;\n colocatedEntities: CompoundEntityRef[];\n unregisterLocation: () => Promise<void>;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'only-delete';\n deleteEntity: () => Promise<void>;\n };\n\n/**\n * Houses the main logic for unregistering entities and their locations.\n */\nexport function useUnregisterEntityDialogState(\n entity: Entity,\n): UseUnregisterEntityDialogState {\n const catalogApi = useApi(catalogApiRef);\n const locationRef = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n const uid = entity.metadata.uid;\n const isBootstrap = locationRef === 'bootstrap:bootstrap';\n\n // Load the prerequisite data: what entities that are colocated with us, and\n // what location that spawned us\n const prerequisites = useAsync(async () => {\n const locationPromise = catalogApi.getLocationByRef(locationRef!);\n\n let colocatedEntitiesPromise: Promise<Entity[]>;\n if (!locationRef) {\n colocatedEntitiesPromise = Promise.resolve([]);\n } else {\n const locationAnnotationFilter = `metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`;\n colocatedEntitiesPromise = catalogApi\n .getEntities({\n filter: { [locationAnnotationFilter]: locationRef },\n fields: [\n 'kind',\n 'metadata.uid',\n 'metadata.name',\n 'metadata.namespace',\n ],\n })\n .then(response => response.items);\n }\n\n return Promise.all([locationPromise, colocatedEntitiesPromise]).then(\n ([location, colocatedEntities]) => ({\n location,\n colocatedEntities,\n }),\n );\n }, [catalogApi, entity]);\n\n // Unregisters the underlying location which will remove all of the entities that are spawned from\n // it. Can only ever be called when the prerequisites have finished loading successfully, and if\n // there was a matching location.\n const unregisterLocation = useCallback(\n async function unregisterLocationFn() {\n const { location } = prerequisites.value!;\n await catalogApi.removeLocationById(location!.id);\n },\n [catalogApi, prerequisites],\n );\n\n // Just removes the entity, without affecting locations in any way.\n const deleteEntity = useCallback(\n async function deleteEntityFn() {\n await catalogApi.removeEntityByUid(uid!);\n },\n [catalogApi, uid],\n );\n\n // If this is a bootstrap location entity, don't even block on loading\n // prerequisites. We know that all that we will do is to offer to remove the\n // entity, and that doesn't require anything from the prerequisites.\n if (isBootstrap) {\n return { type: 'bootstrap', location: locationRef!, deleteEntity };\n }\n\n // Return early if prerequisites still loading or failing\n const { loading, error, value } = prerequisites;\n if (loading) {\n return { type: 'loading' };\n } else if (error) {\n return { type: 'error', error };\n }\n\n const { location, colocatedEntities } = value!;\n if (!location) {\n return { type: 'only-delete', deleteEntity };\n }\n return {\n type: 'unregister',\n location: locationRef!,\n colocatedEntities: colocatedEntities.map(getCompoundEntityRef),\n unregisterLocation,\n deleteEntity,\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 { Entity } from '@backstage/catalog-model';\nimport { EntityRefLink } from '../EntityRefLink';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Divider,\n makeStyles,\n} from '@material-ui/core';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useCallback, useState } from 'react';\nimport { useUnregisterEntityDialogState } from './useUnregisterEntityDialogState';\n\nimport { alertApiRef, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { assertError } from '@backstage/errors';\n\nconst useStyles = makeStyles({\n advancedButton: {\n fontSize: '0.7em',\n },\n});\n\nconst Contents = ({\n entity,\n onConfirm,\n}: {\n entity: Entity;\n onConfirm: () => any;\n}) => {\n const alertApi = useApi(alertApiRef);\n const configApi = useApi(configApiRef);\n const classes = useStyles();\n const state = useUnregisterEntityDialogState(entity);\n const [showDelete, setShowDelete] = useState(false);\n const [busy, setBusy] = useState(false);\n const appTitle = configApi.getOptionalString('app.title') ?? 'Backstage';\n\n const onUnregister = useCallback(\n async function onUnregisterFn() {\n if ('unregisterLocation' in state) {\n setBusy(true);\n try {\n await state.unregisterLocation();\n onConfirm();\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state],\n );\n\n const onDelete = useCallback(\n async function onDeleteFn() {\n if ('deleteEntity' in state) {\n setBusy(true);\n try {\n await state.deleteEntity();\n onConfirm();\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state],\n );\n\n if (state.type === 'loading') {\n return <Progress />;\n }\n\n if (state.type === 'error') {\n return <ResponseErrorPanel error={state.error} />;\n }\n\n if (state.type === 'bootstrap') {\n return (\n <>\n <Alert severity=\"info\">\n You cannot unregister this entity, since it originates from a\n protected Backstage configuration (location \"{state.location}\"). If\n you believe this is in error, please contact the {appTitle}{' '}\n integrator.\n </Alert>\n\n <Box marginTop={2}>\n {!showDelete && (\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n Advanced Options\n </Button>\n )}\n\n {showDelete && (\n <>\n <DialogContentText>\n You have the option to delete the entity itself from the\n catalog. Note that this should only be done if you know that the\n catalog file has been deleted at, or moved from, its origin\n location. If that is not the case, the entity will reappear\n shortly as the next refresh round is performed by the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n )}\n </Box>\n </>\n );\n }\n\n if (state.type === 'only-delete') {\n return (\n <>\n <DialogContentText>\n This entity does not seem to originate from a registered location. You\n therefore only have the option to delete it outright from the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n );\n }\n\n if (state.type === 'unregister') {\n return (\n <>\n <DialogContentText>\n This action will unregister the following entities:\n </DialogContentText>\n <DialogContentText component=\"ul\">\n {state.colocatedEntities.map(e => (\n <li key={`${e.kind}:${e.namespace}/${e.name}`}>\n <EntityRefLink entityRef={e} />\n </li>\n ))}\n </DialogContentText>\n <DialogContentText>\n Located at the following location:\n </DialogContentText>\n <DialogContentText component=\"ul\">\n <li>{state.location}</li>\n </DialogContentText>\n <DialogContentText>\n To undo, just re-register the entity in {appTitle}.\n </DialogContentText>\n <Box marginTop={2}>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onUnregister}\n >\n Unregister Location\n </Button>\n {!showDelete && (\n <Box component=\"span\" marginLeft={2}>\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n Advanced Options\n </Button>\n </Box>\n )}\n </Box>\n\n {showDelete && (\n <>\n <Box paddingTop={4} paddingBottom={4}>\n <Divider />\n </Box>\n <DialogContentText>\n You also have the option to delete the entity itself from the\n catalog. Note that this should only be done if you know that the\n catalog file has been deleted at, or moved from, its origin\n location. If that is not the case, the entity will reappear\n shortly as the next refresh round is performed by the catalog.\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete Entity\n </Button>\n </>\n )}\n </>\n );\n }\n\n return <Alert severity=\"error\">Internal error: Unknown state</Alert>;\n};\n\n/** @public */\nexport type UnregisterEntityDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onClose: () => any;\n entity: Entity;\n};\n\n/** @public */\nexport const UnregisterEntityDialog = (props: UnregisterEntityDialogProps) => {\n const { open, onConfirm, onClose, entity } = props;\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle id=\"responsive-dialog-title\">\n Are you sure you want to unregister this entity?\n </DialogTitle>\n <DialogContent>\n <Contents entity={entity} onConfirm={onConfirm} />\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\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 configApiRef,\n IconComponent,\n useApi,\n} from '@backstage/core-plugin-api';\nimport {\n Card,\n List,\n ListItemIcon,\n ListItemSecondaryAction,\n ListItemText,\n makeStyles,\n MenuItem,\n Theme,\n Typography,\n} from '@material-ui/core';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport StarIcon from '@material-ui/icons/Star';\nimport { compact } from 'lodash';\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\nimport { UserListFilter } from '../../filters';\nimport {\n useEntityList,\n useStarredEntities,\n useEntityOwnership,\n} from '../../hooks';\nimport { UserListFilterKind } from '../../types';\nimport { reduceEntityFilters } from '../../utils';\n\n/** @public */\nexport type CatalogReactUserListPickerClassKey =\n | 'root'\n | 'title'\n | 'listIcon'\n | 'menuItem'\n | 'groupWrapper';\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n root: {\n backgroundColor: 'rgba(0, 0, 0, .11)',\n boxShadow: 'none',\n margin: theme.spacing(1, 0, 1, 0),\n },\n title: {\n margin: theme.spacing(1, 0, 0, 1),\n textTransform: 'uppercase',\n fontSize: 12,\n fontWeight: 'bold',\n },\n listIcon: {\n minWidth: 30,\n color: theme.palette.text.primary,\n },\n menuItem: {\n minHeight: theme.spacing(6),\n },\n groupWrapper: {\n margin: theme.spacing(1, 1, 2, 1),\n },\n }),\n {\n name: 'CatalogReactUserListPicker',\n },\n);\n\nexport type ButtonGroup = {\n name: string;\n items: {\n id: 'owned' | 'starred' | 'all';\n label: string;\n icon?: IconComponent;\n }[];\n};\n\nfunction getFilterGroups(orgName: string | undefined): ButtonGroup[] {\n return [\n {\n name: 'Personal',\n items: [\n {\n id: 'owned',\n label: 'Owned',\n icon: SettingsIcon,\n },\n {\n id: 'starred',\n label: 'Starred',\n icon: StarIcon,\n },\n ],\n },\n {\n name: orgName ?? 'Company',\n items: [\n {\n id: 'all',\n label: 'All',\n },\n ],\n },\n ];\n}\n\n/** @public */\nexport type UserListPickerProps = {\n initialFilter?: UserListFilterKind;\n availableFilters?: UserListFilterKind[];\n};\n\n/** @public */\nexport const UserListPicker = (props: UserListPickerProps) => {\n const { initialFilter, availableFilters } = props;\n const classes = useStyles();\n const configApi = useApi(configApiRef);\n const orgName = configApi.getOptionalString('organization.name') ?? 'Company';\n const {\n filters,\n updateFilters,\n backendEntities,\n queryParameters: { kind: kindParameter, user: userParameter },\n loading: loadingBackendEntities,\n } = useEntityList();\n\n // Remove group items that aren't in availableFilters and exclude\n // any now-empty groups.\n const userAndGroupFilterIds = ['starred', 'all'];\n const filterGroups = getFilterGroups(orgName)\n .map(filterGroup => ({\n ...filterGroup,\n items: filterGroup.items.filter(({ id }) =>\n // TODO: avoid hardcoding kinds here\n ['group', 'user'].some(kind => kind === kindParameter)\n ? userAndGroupFilterIds.includes(id)\n : !availableFilters || availableFilters.includes(id),\n ),\n }))\n .filter(({ items }) => !!items.length);\n\n const { isStarredEntity } = useStarredEntities();\n const { isOwnedEntity, loading: loadingEntityOwnership } =\n useEntityOwnership();\n\n const loading = loadingBackendEntities || loadingEntityOwnership;\n\n // Static filters; used for generating counts of potentially unselected kinds\n const ownedFilter = useMemo(\n () => new UserListFilter('owned', isOwnedEntity, isStarredEntity),\n [isOwnedEntity, isStarredEntity],\n );\n const starredFilter = useMemo(\n () => new UserListFilter('starred', isOwnedEntity, isStarredEntity),\n [isOwnedEntity, isStarredEntity],\n );\n\n const queryParamUserFilter = useMemo(\n () => [userParameter].flat()[0],\n [userParameter],\n );\n\n const [selectedUserFilter, setSelectedUserFilter] = useState(\n queryParamUserFilter ?? initialFilter,\n );\n\n // To show proper counts for each section, apply all other frontend filters _except_ the user\n // filter that's controlled by this picker.\n const entitiesWithoutUserFilter = useMemo(\n () =>\n backendEntities.filter(\n reduceEntityFilters(\n compact(Object.values({ ...filters, user: undefined })),\n ),\n ),\n [filters, backendEntities],\n );\n\n const filterCounts = useMemo<Record<string, number>>(\n () => ({\n all: entitiesWithoutUserFilter.length,\n starred: entitiesWithoutUserFilter.filter(entity =>\n starredFilter.filterEntity(entity),\n ).length,\n owned: entitiesWithoutUserFilter.filter(entity =>\n ownedFilter.filterEntity(entity),\n ).length,\n }),\n [entitiesWithoutUserFilter, starredFilter, ownedFilter],\n );\n\n // Set selected user filter on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamUserFilter) {\n setSelectedUserFilter(queryParamUserFilter as UserListFilterKind);\n }\n }, [queryParamUserFilter]);\n\n useEffect(() => {\n if (\n !loading &&\n !!selectedUserFilter &&\n selectedUserFilter !== 'all' &&\n filterCounts[selectedUserFilter] === 0\n ) {\n setSelectedUserFilter('all');\n }\n }, [loading, filterCounts, selectedUserFilter, setSelectedUserFilter]);\n\n useEffect(() => {\n updateFilters({\n user: selectedUserFilter\n ? new UserListFilter(\n selectedUserFilter as UserListFilterKind,\n isOwnedEntity,\n isStarredEntity,\n )\n : undefined,\n });\n }, [selectedUserFilter, isOwnedEntity, isStarredEntity, updateFilters]);\n\n return (\n <Card className={classes.root}>\n {filterGroups.map(group => (\n <Fragment key={group.name}>\n <Typography variant=\"subtitle2\" className={classes.title}>\n {group.name}\n </Typography>\n <Card className={classes.groupWrapper}>\n <List disablePadding dense role=\"menu\">\n {group.items.map(item => (\n <MenuItem\n key={item.id}\n button\n divider\n onClick={() => setSelectedUserFilter(item.id)}\n selected={item.id === filters.user?.value}\n className={classes.menuItem}\n disabled={filterCounts[item.id] === 0}\n data-testid={`user-picker-${item.id}`}\n >\n {item.icon && (\n <ListItemIcon className={classes.listIcon}>\n <item.icon fontSize=\"small\" />\n </ListItemIcon>\n )}\n <ListItemText>\n <Typography variant=\"body1\">{item.label}</Typography>\n </ListItemText>\n <ListItemSecondaryAction>\n {filterCounts[item.id] ?? '-'}\n </ListItemSecondaryAction>\n </MenuItem>\n ))}\n </List>\n </Card>\n </Fragment>\n ))}\n </Card>\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, {\n PropsWithChildren,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n DefaultEntityFilters,\n EntityListContext,\n EntityListContextProps,\n} from '../hooks/useEntityListProvider';\n\n/** @public */\nexport const MockEntityListContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value?: Partial<EntityListContextProps>;\n}>) => {\n // Provides a default implementation that stores filter state, for testing components that\n // reflect filter state.\n const [filters, setFilters] = useState<DefaultEntityFilters>(\n value?.filters ?? {},\n );\n\n const updateFilters = useCallback(\n (\n update:\n | Partial<DefaultEntityFilters>\n | ((\n prevFilters: DefaultEntityFilters,\n ) => Partial<DefaultEntityFilters>),\n ) => {\n setFilters(prevFilters => {\n const newFilters =\n typeof update === 'function' ? update(prevFilters) : update;\n return { ...prevFilters, ...newFilters };\n });\n },\n [],\n );\n\n // Memoize the default values since pickers have useEffect triggers on these; naively defaulting\n // below with `?? <X>` breaks referential equality on subsequent updates.\n const defaultValues = useMemo(\n () => ({\n entities: [],\n backendEntities: [],\n queryParameters: {},\n }),\n [],\n );\n\n const resolvedValue: EntityListContextProps = useMemo(\n () => ({\n entities: value?.entities ?? defaultValues.entities,\n backendEntities: value?.backendEntities ?? defaultValues.backendEntities,\n updateFilters: value?.updateFilters ?? updateFilters,\n filters,\n loading: value?.loading ?? false,\n queryParameters: value?.queryParameters ?? defaultValues.queryParameters,\n error: value?.error,\n }),\n [value, defaultValues, filters, updateFilters],\n );\n\n return (\n <EntityListContext.Provider value={resolvedValue}>\n {children}\n </EntityListContext.Provider>\n );\n};\n"],"names":["isEqual","getEntityRef","useStyles","icon","checkedIcon","MuiListItemText","MuiListSubheader","Contents","groupBy","DialogContentText","Alert","StarIcon","ListItemText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACY,MAAC,aAAa,GAAG,YAAY,CAAC;AAC1C,EAAE,EAAE,EAAE,wBAAwB;AAC9B,CAAC;;ACFW,MAAC,qBAAqB,GAAG,YAAY,CAAC;AAClD,EAAE,EAAE,EAAE,gCAAgC;AACtC,CAAC;;ACFM,MAAM,sBAAsB,CAAC;AACpC,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,eAAe,mBAAmB,IAAI,GAAG,EAAE,CAAC;AACrD,IAAI,IAAI,CAAC,WAAW,mBAAmB,IAAI,GAAG,EAAE,CAAC;AACjD,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,cAAc,CAAC,CAAC,UAAU,KAAK;AACzD,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;AACrD,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACvC,MAAM,OAAO,MAAM;AACnB,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM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AAG,KAAK,CAAC,QAAQ,KAAK,IAAI,GAAG,GAAG,GAAG,aAAa,CAAC,QAAQ;AACtG,MAAM,eAAe,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,eAAe;AACzH,MAAM,aAAa,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa;AACrG,MAAM,OAAO;AACb,MAAM,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK;AACjF,MAAM,eAAe,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,KAAK,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,eAAe;AACzH,MAAM,KAAK,EAAE,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK;AACjD,KAAK,CAAC;AACN,GAAG,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AACrD,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,QAAQ,EAAE;AACzE,IAAI,KAAK,EAAE,aAAa;AACxB,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
3
  "description": "A frontend library that helps other Backstage plugins interact with the catalog",
4
- "version": "1.1.0-next.0",
4
+ "version": "1.1.0-next.1",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -36,13 +36,13 @@
36
36
  "dependencies": {
37
37
  "@backstage/catalog-client": "^1.0.1",
38
38
  "@backstage/catalog-model": "^1.0.1",
39
- "@backstage/core-components": "^0.9.3",
40
- "@backstage/core-plugin-api": "^1.0.1",
39
+ "@backstage/core-components": "^0.9.4-next.0",
40
+ "@backstage/core-plugin-api": "^1.0.2-next.0",
41
41
  "@backstage/errors": "^1.0.0",
42
42
  "@backstage/integration": "^1.2.0-next.0",
43
43
  "@backstage/plugin-catalog-common": "^1.0.1",
44
44
  "@backstage/plugin-permission-common": "^0.6.0",
45
- "@backstage/plugin-permission-react": "^0.4.0",
45
+ "@backstage/plugin-permission-react": "^0.4.1-next.0",
46
46
  "@backstage/theme": "^0.2.15",
47
47
  "@backstage/types": "^1.0.0",
48
48
  "@backstage/version-bridge": "^1.0.1",
@@ -63,11 +63,11 @@
63
63
  "react": "^16.13.1 || ^17.0.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@backstage/cli": "^0.17.1-next.0",
67
- "@backstage/core-app-api": "^1.0.1",
66
+ "@backstage/cli": "^0.17.1-next.1",
67
+ "@backstage/core-app-api": "^1.0.2-next.0",
68
68
  "@backstage/plugin-catalog-common": "^1.0.1",
69
69
  "@backstage/plugin-scaffolder-common": "^1.0.1",
70
- "@backstage/test-utils": "^1.0.2-next.0",
70
+ "@backstage/test-utils": "^1.1.0-next.1",
71
71
  "@testing-library/jest-dom": "^5.10.1",
72
72
  "@testing-library/react": "^12.1.3",
73
73
  "@testing-library/react-hooks": "^8.0.0",
@@ -82,5 +82,5 @@
82
82
  "dist",
83
83
  "alpha"
84
84
  ],
85
- "gitHead": "88ee375f5ee44b7a7917297785ddf88691fe3381"
85
+ "gitHead": "0b3df66a238c66a5498dab85b1ed85a8607289f1"
86
86
  }