@@ -16,7 +16,10 @@
|
||||
|
||||
import React, { ComponentType } from 'react';
|
||||
import { Entity, stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import {
|
||||
isTemplateEntityV1beta3,
|
||||
TemplateEntityV1beta3,
|
||||
} from '@backstage/plugin-scaffolder-common';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
@@ -28,7 +31,6 @@ import {
|
||||
import { useEntityList } from '@backstage/plugin-catalog-react';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { TemplateCard } from '../TemplateCard';
|
||||
import { isTemplateEntity } from '../../lib/isTemplateEntity';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -54,7 +56,7 @@ export const TemplateList = ({
|
||||
}: TemplateListProps) => {
|
||||
const { loading, error, entities } = useEntityList();
|
||||
const Card = TemplateCardComponent || TemplateCard;
|
||||
const templateEntities = entities.filter(isTemplateEntity);
|
||||
const templateEntities = entities.filter(isTemplateEntityV1beta3);
|
||||
const maybeFilteredEntities = (
|
||||
group ? templateEntities.filter(group.filter) : templateEntities
|
||||
).filter(e => (templateFilter ? !templateFilter(e) : true));
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
|
||||
export const isTemplateEntity = (
|
||||
entity: Entity,
|
||||
): entity is TemplateEntityV1beta3 =>
|
||||
entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&
|
||||
entity.kind === 'Template';
|
||||
Reference in New Issue
Block a user